gcc 搜索不到头文件的问题,为啥?
时间:2010-07-14
来源:互联网
Feroder11, 要用jrtp的头文件。
已经在/etc/bashrc 设置了 export PATH=$PATH:/usr/include/jrtplib3/
然后用echo PATH也显示设置好了
也重起系统了
但是gcc(或者说是g++)死活找不到/usr/include/jrtplib3/的路径, 为什么?
(顺便提一下,用VPATH=/usr/inluce/jrtplib3/也不行, 但是用 -I /usr/include/jrtplib3就可以)
已经在/etc/bashrc 设置了 export PATH=$PATH:/usr/include/jrtplib3/
然后用echo PATH也显示设置好了
也重起系统了
但是gcc(或者说是g++)死活找不到/usr/include/jrtplib3/的路径, 为什么?
(顺便提一下,用VPATH=/usr/inluce/jrtplib3/也不行, 但是用 -I /usr/include/jrtplib3就可以)
作者: keneth2078 发布时间: 2010-07-14
-I
作者: prolj 发布时间: 2010-07-14
GCC不使用PATH环境变量搜索include目录路径,不过用以下这些环境变量都可以。
CPATH
C_INCLUDE_PATH
CPLUS_INCLUDE_PATH
OBJC_INCLUDE_PATH
Each variable's value is a list of directories separated by a special 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 specified with -I, but after any paths given with -I options on the command 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 directories 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'.
来源: http://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html
CPATH
C_INCLUDE_PATH
CPLUS_INCLUDE_PATH
OBJC_INCLUDE_PATH
Each variable's value is a list of directories separated by a special 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 specified with -I, but after any paths given with -I options on the command 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 directories 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'.
来源: http://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html
作者: 没本 发布时间: 2010-07-14








作者: mirnshi 发布时间: 2010-07-14
回复 没本
用VPATH在makefile里面也设置不了吗?
用VPATH在makefile里面也设置不了吗?
作者: keneth2078 发布时间: 2010-07-14
VPATH是make用的,GCC不使用这个环境变量。
作者: 没本 发布时间: 2010-07-14
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28