通过使用这些作为我的主要和类构造函数,我得到了以下错误。
#include<Process.h>
int main(int argc, char* argv[])
{
Process pr (0.01,0.0,argv[3],argv[4],argv[5]);
return 1;
}
和进程类标题:
class Process
{
public:
Process();
Process(double BinSize,double Offset,const std::string& parameters,const std::string& TDBname,const std::string& DDBname);
virtual ~Process();
};
和进程类源:
Process::Process()
{
//ctor
}
Process::Process(double BinSize,double Offset,const std::string& TDBname,const std::string& DDBname,const std::string& parameters)
{
//ctor
cout<<TDBname;
}
但是当我通过Ubuntu 12.10编译代码时,我得到了:
main.cpp:(.text.startup+0xf7): undefined reference to `Process::Process(double, double, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
我不知道这个错误来自哪里!提前谢谢。