通过将它们用作我的主构造函数和类构造函数,我得到了以下错误。
#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&)'
我不知道这个错误来自哪里!先感谢您。