首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

eclipse gcc,都报undefined reference to .解决方案

2013-04-20 
eclipse gcc,都报undefined reference to ...我看了,是用函数参数用const string&的地方报的,网上看了,说

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>吗?

引用:
我看了,是用函数参数用const string&amp;的地方报的,

网上看了,说是用g++而不是gcc,但我用的就是g++啊
FindFiles .h文件
C/C++ code?1234class FindFiles {public:    void Search(const std::string&amp; dir);};
main文件里include了F……

[解决办法]
http://stackoverflow.com/questions/3656050/c-undefined-reference-to-foofoostdstring

热点排行