Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/vim/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 未找到头文件错误_C++ - Fatal编程技术网

C++ 未找到头文件错误

C++ 未找到头文件错误,c++,C++,我正在尝试测试软件中的特定功能。我已经为此编写了一个小测试文件,如下所示 #include<iostream> #include "bignum.h" #include "Equation.h" #include "matrix.h" #include "hermite.h" using namespace std; int main() { matrix* mat = new matrix(3, 1, new vector<string>());

我正在尝试测试软件中的特定功能。我已经为此编写了一个小测试文件,如下所示

#include<iostream>
#include "bignum.h"
#include "Equation.h"
#include "matrix.h"
#include "hermite.h"

using namespace std;

int main() {
        matrix* mat = new matrix(3, 1, new vector<string>());
        hnf(&mat);
}   
#包括
#包括“bignum.h”
#包括“方程式h”
#包括“矩阵h”
#包括“hermite.h”
使用名称空间std;
int main(){
矩阵*mat=新矩阵(3,1,新向量());
hnf&mat;
}   
我的目录和文件结构如下。方程.h包括bignum.h,而hermite.h包括方程.h和矩阵.h。除Equation.h之外的所有文件都在同一目录中,而Equation.h则在其他目录中


我无法找到用g++编译test.cpp的正确方法。

您需要使用标志
-I
,替换
,告诉g++在哪里搜索头文件。

也许您需要包括以下内容:
\include
您应该只包括
hermite.h
,因为
herimite.h
包含另外三个。@molbdnilo我的错误:我正在尝试使用命令“g++-o exe test.cpp-I./../solver”进行编译,其中../solver/是文件Equation.h的目录。它说文件等式.h不存在。