linux执行文件时找不到.so

https://blog.csdn.net/qq_23670601/article/details/82966686

在执行文件的时候提示找不到.so,只需要:

1.打开下面的文件

sudo gedit /etc/ld.so.conf
  
  

2.

在打开的文件中添加你的.so文件所在的目录,添加完效果如下

include /etc/ld.so.conf.d/*.conf 
/home/wxw/modbusqt/modbussolibrary/build-RobotInterface-Desktop_Qt_5_11_0_GCC_64bit-Release

第一行原来就有,然后回车写第二行,不是空格也不用加include(这里我折腾了好久)

3.保存,然后

sudo ldconfig
  
  

就大功告成了。

检查方法,

ldd ./filename
  
  

可以看到.so都能找到了。

猜你喜欢

转载自blog.csdn.net/qq_32534441/article/details/90574829