eclipse gcc,都报undefined reference to ...
我看了,是用函数参数用const string&的地方报的,
网上看了,说是用g++而不是gcc,但我用的就是g++啊
FindFiles .h文件
class FindFiles {
public:
void Search(const std::string& dir);
};main文件里include了FindFiles.h
main函数里调用了Search函数,就显示string这里有问题.
但是我在main函数里直接用string没事.
[解决办法]
http://cplusplus.syntaxerrors.info/index.php?title=Undefined_reference_to_%60std::basic_string(char,_std::char_traits(char),_std::allocator(char))::basic_string()'
[解决办法]
#include "FindFiles.h"之前有#include <string>吗?
[解决办法]
http://stackoverflow.com/questions/3656050/c-undefined-reference-to-foofoostdstring