Loading

Linux系统下手动导入各种PATH变量


PATH:可执行文件的路径

export PATH=$HOME/my-bin:$PATH

LIBRARY_PATH:程序编译时查找库的路径

export LIBRARY_PATH=$HOME/my-lib:$LIBRARY_PATH

LD_LIBRARY_PATH:程序链接时查找库的路径

export LD_LIBRARY_PATH=$HOME/my-lib:$LD_LIBRARY_PATH

LIBRARY_PATH 和 LD_LIBRARY_PATH区别

  • LIBRARY_PATH是程序编译期间查找动态链接库时指定查找共享库的路径。
  • LD_LIBRARY_PATH是程序加载运行期间查找动态链接库时指定除了系统默认路径之外的其他路径。

C_INCLUDE_PATH:gcc找头文件的路径

export C_INCLUDE_PATH=$HOME/my-c-include:$C_INCLUDE_PATH

CPLUS_INCLUDE_PATH:g++找头文件的路径

export CPLUS_INCLUDE_PATH=$HOME/my-cxx-include:$CPLUS_INCLUDE_PATH
posted @ 2022-03-09 17:08  刘跑跑  阅读(207)  评论(0编辑  收藏  举报