所以基本上我有一些非常简单的代码,其中包括 <BigIntegerLibrary.hh>
位于 /Users/wen/Projects/include/bigint
.我正在用这个编译:
g++ main.cpp -o Main -I/Users/wen/Projects/include/bigint
但它报告了一个 fatal error ,它找不到该文件。我做对了吗?谢谢!
main.cpp:4:10: fatal error: 'BigIntegerLibrary.hh' file not found
最佳答案
尝试
#include "BigIntegerLibrary.hh"
如果您使用尖括号 (#include <includeFile.h>
) 指定 #included 文件,编译器将尝试在预定义的位置找到它,而如果您使用 #include "includeFile"
编译器首先尝试使用 -I
指定的路径编译器选项。
-I
编译器选项不能用于指定 <...>
的位置文件是。
关于c++ - g++即使指定了标题也找不到标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13938298/