开发者

How to add multiple header include and library directories to the search path in a single gcc command?

开发者 https://www.devze.com 2023-03-02 01:58 出处:网络
How to add multiple header inclu开发者_Python百科de and library directories to the search path in a single gcc command?Use multiple -I flags for the include directories and multiple -L flags for the l

How to add multiple header inclu开发者_Python百科de and library directories to the search path in a single gcc command?


Use multiple -I flags for the include directories and multiple -L flags for the lib directories


You can set the C_INCLUDE_PATH environment variable.

export C_INCLUDE_PATH=.:/some/dir:/some/other/dir

as well as the LIBRARY_PATH environment variable.


On Linux you need to use -I before each directory that you want to add.

Example:

user:/home/my_project$ gcc -g -Wall -I/usr/include/lib_Directory/ -I./include -c ./src/transcod.c

./ means the current directory where you are running the command, in this case my_project;

0

精彩评论

暂无评论...
验证码 换一张
取 消