Cmake: linking shared library

前端 未结 3 646
失恋的感觉
失恋的感觉 2021-02-06 10:40

I\'ve done this before a couple of times, but somehow I\'m stuck this time. I have an executable \"myapp\" and a own shared library \"mylib\". In my cmakelists I have the follow

3条回答
  •  遇见更好的自我
    2021-02-06 11:02

    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.

提交回复
热议问题