C++ error: 'string' does not name a type

include一个定义结构体的文件typedef.h

编译出现了error: 'string' does not name a type

 

查资料http://blog.csdn.net/niro_z/article/details/8028996得到提示,

要在string改为std::string就OK了。

但是这样还是有点别扭,于是这么改

using namespace std;
#include "typedef.h"

就OK了

posted @ 2015-09-01 10:51  firerdong  阅读(18815)  评论(0编辑  收藏  举报