我已阅读有关此主题的其他问题,但仍不知道如何解决我的问题
预先感谢您的帮助!
我的错误是:
体系结构 x86_64 的未定义符号:
“Record::Record(std::__1::vector, std::__1::allocator >, std::__1::allocator, std::__1::allocator >>>, double*)”,引用自:
_main 在 akh70P3ClassTester-946637.o
ld:未找到架构 x86_64 的符号
Record.h
#include <string>
#include <vector>
using namespace std;
class Record
{
public:
Record();
Record(vector<string> , double []);
private:
//some variables
};
记录.cpp
#include "Record.h"
#include <string>
#include <vector>
using namespace std;
Record::Record() {}
Record::Record(vector<string> inputs, double num_inputs[] )
{
//variables happens
}
Main.cpp
#include "Record.h"
#include <vector>
using namespace std;
int main() {
vector<string> inputs;
double num_inputs[] = {};
Record temp(inputs, num_inputs);
return 0;
}
您可能没有在编译中包含 Report.cpp,例如只做g++ main.cpp -o main
相反,通过包含报告文件来编译您的程序:g++ main.cpp report.cpp -o main
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)