Ubuntu下的Qt库依赖性

Ubuntu下的Qt库依赖性,qt,shared-libraries,Qt,Shared Libraries,我有一个依赖OpenMesh的Qt应用程序。我从源代码构建OpenMesh库: cmake ... make make install 它安装到/usr/local/lib/OpenMesh文件夹: lib包含在Qt项目中 LIBS += -L/usr/local/lib/OpenMesh/ \ -lOpenMeshCored \ -lOpenMeshToolsd 当我从Qt Creator启动应用程序时,

我有一个依赖OpenMesh的Qt应用程序。我从源代码构建OpenMesh库:

cmake ...
make
make install
它安装到/usr/local/lib/OpenMesh文件夹:

lib包含在Qt项目中

LIBS +=          -L/usr/local/lib/OpenMesh/ \
                 -lOpenMeshCored \
                 -lOpenMeshToolsd
当我从Qt Creator启动应用程序时,它工作正常。但如果我从命令行启动构建的可执行文件,它将返回以下错误:

error while loading shared libraries: libOpenMeshCored.so.3.2: cannot open shared object file: No such file or directory
那么为什么它知道在哪里找到共享对象,当我从Qt开始时,为什么不知道,当我没有它时


我该如何解决这个问题?

当你说你是从Qt启动它时,你是说Qt creator吗?如果你知道它可能是重复的,那么当我从Qt creator启动它时,在共享对象方面会发生什么情况,这会很有帮助。你在安装OpenMesh后是否运行了ldconfig?ldconfig解决了这个问题,谢谢。
error while loading shared libraries: libOpenMeshCored.so.3.2: cannot open shared object file: No such file or directory