虚拟机调试asla-lib

英文,5分钟自动息屏不要改,最后硬件默认不改

重启

终端add+光盘弹出
sudo apt-get install open-vm-tools
sudo apt-get install open-vm-tools-desktop

重启
 

sudo apt install openssh-server
sudo apt install net-tools

C:\Users\chuan\.ssh,删除known_hosts中的机器记录


touch pcm_min.c

touch makefile

gcc -g pcm_min.c -lasound  -o pcm_min

sudo apt-get install build-essential

sudo apt-get install pkg-config

sudo apt-get install libtool

sudo apt-get install make

make说缺少头文件

wget http://www.alsa-project.org/files/pub/lib/alsa-lib-1.2.10.tar.bz2

tar -jxvf file/alsa-lib-1.2.10.tar.bz2 -C ./

cd alsa-lib-1.2.10

sudo ./configure

sudo make install

现在make 告警

<alsa/asoundlib.h>

ls /usr/include/alsa

吵就对了

先关闭远程连接,然后重启

快照:alsa

---------------------------------------------------------------------------------------------------------------------

调试动态库,只需要一步-L即可:

1 makefile

target = pcm_min

all:${target}.c
	gcc -g ${target}.c -lasound  -o ${target}

clean:
	rm ${target}

run:
	./${target}

gcc:
	ldd ${target}

debug:
	gdb -q ${target}
    # b snd_pcm_open

2 sudo cp /usr/lib/libasound.so.2 /lib/x86_64-linux-gnu/libasound.so.2

以后再研究为什么吧,累了

重新走一遍步骤:

1 makefile

2.1 sudo cp /usr/lib/libasound.so.2 /lib/x86_64-linux-gnu/libasound.so.2

这种方法为什么可以啊?

2.2 之前的方法是是删除默认的libasound.2

sudo rm /lib/x86_64-linux-gnu/libasound.so.2
sudo rm /lib/x86_64-linux-gnu/libasound.so.2.0.0

2.3 指定库目录

准备单步调试

删了软连接:

sudo rm /lib/x86_64-linux-gnu/libasound.so.2

/usr/lib/alsa-lib/libasound_module_conf_pulse.so

用pkgconfig吧

usr/lib$ find ./ -name "*.pc"
 

sudo cp /usr/lib/libasound.so.2 /lib/x86_64-linux-gnu/libasound.so.2

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值