且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

CMake:链接共享库

更新时间:2022-06-25 03:47:45

在安装库和可执行文件期间,会从可执行文件中删除用于查找库的运行时路径.因此,您的库必须驻留在运行时库搜索路径中.例如,在Linux下,启动可执行文件时,尝试将LD_LIBRARY_PATH设置为包含已安装库的目录.

During the installation of your library and executable, the runtime paths to find the library are stripped from the executable. Therefore your library has to reside in the runtime library search path. For example under Linux, try to set LD_LIBRARY_PATH to the directory that contains the installed library when starting your executable.