解决./exam5-5: error while loading shared libraries: libdemo.so: cannot open shared object file:



在使用动态库的时候,已经生成了可执行文件(exam5-5)了,但是输入./exam5-5运行时报错:

./exam5-5: error while loading shared libraries: libdemo.so: cannot open shared object file: No such file or directory

这是因为运行时系统无法找到你的动态库,这时候要配置一下:

进入/etc/ld.so.conf.d/目录下


新建一个文件:demo.conf(libdemo,so)

然后再demo.conf中写入libdemo.so的路径

我这里是   /home/lan/桌面/GNU C/动态库


最后一root身份输入:/sbin/ldconfig-v

让改成的配置文件生效即可

然后就可以运行啦:

参考:运行错误:error while loading shared libraries: xxx.so.0:cannot open shared object file: No such file or


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值