Linux 下指定程序运行时动态库搜索路径

  • rpath 指定
    可以在编译时指定,例如

    g++ -rpath=/your/path:/your/path1
    

    使用 : 分割路径
    也可以用 chrpath 修改

  • shell 指定 LD_LIBRARY_PATH 变量

  • 配置文件 /etc/ld.so.conf 中指定的动态库搜索路径以及 /etc/ld.so.conf.d/文件夹的配置文件中的内容;

posted @ 2024-01-02 10:06  drink_crow  阅读(227)  评论(0)    收藏  举报