当前位置:网站首页>GCC: paths to header and library files

GCC: paths to header and library files

2022-08-05 00:45:00 calm as a cloud

GCC has the following environment variables for specifying paths to header and library files:

C_INCLUDE_PATH: specifies the C header file path

CPLUS_INCLUDE_PATH: used to specify the C++ header file path

LD_LIBRARY_PATH: used to specify the path of the library file at runtime (the priority is higher than the default search path of the system)

LIBRARY_PATH: used to specify the path to the library file when compiling

If you need to modify these environment variables, you can use the following methods:

1. Input directly in the command line (only valid once, invalid after the terminal is closed), such as:

export C_INCLUDE_PATH=XXXX:$C_INCLUDE_PATH

2. Complete the modification in /etc/profile (effective for all users), such as:

export C_INCLUDE_PATH=XXXX:$C_INCLUDE_PATH

3. Modify ~/.bashrc (effective for the current user), such as:

export C_INCLUDE_PATH=XXXX:$C_INCLUDE_PATH

Alternatively, you can specify the path at compile time:

-I XXX: specify the path to the header file

-L XXX: specify static/dynamic library path (compile time)

原网站

版权声明
本文为[calm as a cloud]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/217/202208050040243107.html