当前位置: 技术问答>linux和unix
关于gcc编译的问题,如何知道其包含路径
来源: 互联网 发布时间:2015-06-15
本文导语: Linux 7.3中同时有g++2.96和g++3.02 例如test.cpp #include int main() { return 0; } 看c++头文件应该在/usr/include/g++-2/iostream和/usr/include/g++-3/iostream 而g++ -o test test.cpp并没有指定包含的路径,g++如何知道包含那个文件 后来我又装...
Linux 7.3中同时有g++2.96和g++3.02
例如test.cpp
#include
int main()
{
return 0;
}
看c++头文件应该在/usr/include/g++-2/iostream和/usr/include/g++-3/iostream
而g++ -o test test.cpp并没有指定包含的路径,g++如何知道包含那个文件
后来我又装了一个gcc3.3.3
文件在/usr/local/include/c++/3.3.3/iostream,如何让g++知道文件的位置呢
不要告诉我用-I/usr/local/include/c++/3.3.3 ,我想知道如何设置默认的
例如test.cpp
#include
int main()
{
return 0;
}
看c++头文件应该在/usr/include/g++-2/iostream和/usr/include/g++-3/iostream
而g++ -o test test.cpp并没有指定包含的路径,g++如何知道包含那个文件
后来我又装了一个gcc3.3.3
文件在/usr/local/include/c++/3.3.3/iostream,如何让g++知道文件的位置呢
不要告诉我用-I/usr/local/include/c++/3.3.3 ,我想知道如何设置默认的
|
gcc -print-search-dirs可以看到gcc要搜索的路径的列表,如果不在列表内,估计旧得用你所说的选项啦!
|
up
|
info gcc中说:
search header files in the standard system directories
search header files in the standard system directories
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。