Petalinux create app时报错
mrzhang@ubuntu:~/works/MZ702P_FEP$ petalinux-create -t apps -n testapp --enable --force
INFO: Create apps: testapp
WARNING: Component "/home/mrzhang/works/MZ702P_FEP/project-spec/meta-user/recipes-apps/testapp" already exists.
WARNING: --force parameter specified, overwriting
INFO: New apps successfully created in /home/mrzhang/works/MZ702P_FEP/project-spec/meta-user/recipes-apps/testapp
INFO: Enabling created component...
INFO: sourcing bitbake
INFO: oldconfig rootfs
INFO: testapp has been enabled
Failed to open PetaLinux lib: librdi_commonxillic.so: cannot open shared object file: No such file or directory.
解决办法
sudo echo "/opt/pkg/petalinux/2018.3/tools/lib" > /etc/ld.so.conf.d/petalinux.so.conf
sudo ldconfig
引申内容:
Linux 遇到 cannot open shared object file解决方法:
一、linux下调用动态库.so文件时提示:
cannot open shared object file: No such file or directory
解决办法:
1、此时ldd xxx查看依赖缺少哪些库
libmysqlcppconn.so.7 => not found
libboost_system.so.1.64.0 => not found
2、设置变量 LD_LIBRARY_PATH
sudo gedit ~/.bashrc
最后一行加上:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/your/path
重新打开bash,再ldd,就可以找到库路径了。
二、(推荐)修改共享库配置文件/etc/ld.so.conf
/etc/ld.so.conf
1、设置:
sudo gedit /etc/ld.so.conf
2、添加库路径:
include /etc/ld.so.conf.d/*.conf
/home/xxx/Documents/core/Linux/Test/src/Test
保存退出;
3、使配置立即生效
sudo ldconfig