Linux Eclipse CDT C++提示 Type 'string' could not be resolved或Type 'std' could not be resolved

来源:互联网 发布:2017年网络歌曲大全 编辑:程序博客网 时间:2024/05/16 18:37

Eclipse 下载的时候有好几个版本的,如果C++开发的,你可以直接下载带CDT版本的:点击打开链接,你也可以直接下标准版,安装完之后,再去装插件。

安装好之后,刚刚新的环境都会有提示 Type 'string' could not be resolved,你可以include <string> 进来,

但using std::string都会报错Type 'string' could not be resolved。

这是因为没有导入C++包,汗!

解决办法:在你的C++项目上右键,propertie_C/C++General_indexer_打勾Enble project specific settings 打勾Index unused headers as c++ files。这两项打开之后,就能使用C++标准头了。

0 0
原创粉丝点击