我已经阅读了有关此主题的其他问题,但仍然没有弄清楚如何解决我的问题
提前感谢您的帮助!
我的错误是:
架构x86_64的未定义符号: “Record :: Record(std :: __ 1 :: vector,std :: __ 1 :: allocator>,std :: __ 1 :: allocator,std :: __ 1 :: allocator>>>,double *)” ,引自: _main in akh70P3ClassTester-946637.o ld:找不到架构x86_64的符号
#include <string>
#include <vector>
using namespace std;
class Record
{
public:
Record();
Record(vector<string> , double []);
private:
//some variables
};
#include "Record.h"
#include <string>
#include <vector>
using namespace std;
Record::Record() {}
Record::Record(vector<string> inputs, double num_inputs[] )
{
//variables happens
}
#include "Record.h"
#include <vector>
using namespace std;
int main() {
vector<string> inputs;
double num_inputs[] = {};
Record temp(inputs, num_inputs);
return 0;
}
答案 0 :(得分:2)
您可能不会在编辑中包含Report.cpp,例如只做g++ main.cpp -o main
而是通过包含报告文件来编译您的程序:g++ main.cpp report.cpp -o main