5。-include和-I参数
-include用来包含头文件,但一般情况下包含头文件都在源码里用#include xxxxxx实现,-include参数很少用。-I参数
是用来指定头文件目录,/usr/include目录一般是不用指定的,gcc知道去那里找,但是如果头文件不在/usr/include里
我们就要用-I参数指定了,比如头文件放在/myinclude目录里,那编译命令行就要加上-I/myinclude参数了,如果不加
你会得到一个"xxxx.h: No such file or directory"的错误。-I参数可以用相对路径,比如头文件在当前目录,可以用
-I.来指定。上面我们提到的--cflags参数就是用来生成-I参数的。
辛苦辛苦,
我编译成功了,现实如下,是什么意思呀?
In file included from /usr/include/c++/3.2.2/backward/iostream.h:31,
from sum.cpp:2:
/usr/include/c++/3.2.2/backward/backward_warning.h:32:2: warning: #warning This
file includes at least one deprecated or antiquated header. Please consider usin
g one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples
include substituting the <X> header for the <X.h> header for C++ includes, or <s
stream> instead of the deprecated header <strstream.h>. To disable this warning
use -Wno-deprecated.