Why the installed program has error when loading shared library in linux (cmake)

后端 未结 3 1698
说谎
说谎 2020-12-12 04:39

I have a question related to how to install a built executable program with cmake when it relies on some external libraries. Suppose my executable is abc, and i

3条回答
  •  鱼传尺愫
    2020-12-12 04:58

    If the application is to be cleanly installed to a standard linux distribution, then you should either install the supporting shared libraries into a standard location (/usr/lib), or you should add the libraries location to the ld.so config, by create an /etc/ld.so.conf.d/myprogram.conf file containing the name of the directory the libraries are in.

    If the installation is temporary or more ad-hoc, then a script to set the LD_LIBRARY_PATH is suitable.

提交回复
热议问题