|
|
发表于 2005-10-11 14:00:35
|
显示全部楼层
Post by nathaniel
我知道有一个环境变量LD_LIBRARY_PATH是用来更改动态库的路径吧?但是头文件和一些静态的库文件的搜索路径又怎样更改呢?
man gcc:
- LIBRARY_PATH
- The value of LIBRARY_PATH is a colon-separated list of directories,
- much like PATH. When configured as a native compiler, GCC tries
- the directories thus specified when searching for special linker
- files, if it can't find them using GCC_EXEC_PREFIX. Linking using
- GCC also uses these directories when searching for ordinary
- libraries for the -l option (but directories specified with -L come
- first).
- CPATH
- C_INCLUDE_PATH
- CPLUS_INCLUDE_PATH
- OBJC_INCLUDE_PATH
- Each variable's value is a list of directories separated by a spe-
- cial character, much like PATH, in which to look for header files.
- The special character, "PATH_SEPARATOR", is target-dependent and
- determined at GCC build time. For Microsoft Windows-based targets
- it is a semicolon, and for almost all other targets it is a colon.
- CPATH specifies a list of directories to be searched as if speci-
- fied with -I, but after any paths given with -I options on the com-
- mand line. This environment variable is used regardless of which
- language is being preprocessed.
- The remaining environment variables apply only when preprocessing
- the particular language indicated. Each specifies a list of direc-
- tories to be searched as if specified with -isystem, but after any
- paths given with -isystem options on the command line.
- In all these variables, an empty element instructs the compiler to
- search its current working directory. Empty elements can appear at
- the beginning or end of a path. For instance, if the value of
- CPATH is ":/special/include", that has the same effect as
- -I. -I/special/include.
复制代码 |
|