C ++:使用const字符串引用作为构造函数参数

时间:2013-11-19 01:49:04

标签: c++ eclipse string

在eclipse中,它没有给我带来任何问题,当我尝试使用g ++从终端进行编译时,它就像是

MyClass.cpp :(。text + 0x129):未定义引用`MyClass2 :: MyClass2(int,std :: basic_string,std :: allocator>,int,int,double)'

对于一行,我只是为构造函数参数传递一个带引号的字符串行“thisValue”。如果参数的类型改为常规字符串,那很好,但是当我做const string&相反,g ++抱怨,而eclipse则没有。怎么样?

0 个答案:

没有答案