g ++即使在指定时也找不到标题 [英] g++ can't find headers even when it's specified
问题描述
/ Users / wen / Projects / include /中的< BigIntegerLibrary.hh>
BIGINT
。我正在编译: g ++ main.cpp -o Main -I / Users / wen / Projects / include / bigint
但它报告了一个致命错误,它无法找到该文件。我做对了吗?
$ b
main.cpp:4:10:致命错误:'BigIntegerLibrary.hh'文件未找到
尝试
#包含BigIntegerLibrary.hh
如果指定 #included 文件尖括号( #include< includeFile.h>
)编译器会尝试在预定义位置找到它,而如果使用 #includeincludeFile
编译器首先尝试使用 -I
编译器选项指定的路径。
-I
编译器选项不能用于指定< ...>
文件的位置。
So basically I have some really simple code that includes <BigIntegerLibrary.hh>
which resides in /Users/wen/Projects/include/bigint
. I was compiling with this:
g++ main.cpp -o Main -I/Users/wen/Projects/include/bigint
but it reported a fatal error that it could not find the file. Am I doing it right? Thanks!
main.cpp:4:10: fatal error: 'BigIntegerLibrary.hh' file not found
Try
#include "BigIntegerLibrary.hh"
If you specify the #included file with angle brackets (#include <includeFile.h>
) the compiler will try to find it in a predefined location whereas if you use #include "includeFile"
the compiler first tries the paths you specified with the -I
compiler option.
The -I
compiler option cannot be used to specify where the <...>
files are.
这篇关于g ++即使在指定时也找不到标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!