C ++错误类型'std :: thread'无法解析Eclipse Mars 4.5,Ubuntu 12.04 [英] C++ error Type 'std::thread' could not be resolved Eclipse Mars 4.5 , Ubuntu 12.04

查看:138
本文介绍了C ++错误类型'std :: thread'无法解析Eclipse Mars 4.5,Ubuntu 12.04的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很绝望. Eclipse不断给出错误

I am quite desperate. Eclipse keeps on giving the error

'std::thread' could not be resolved

我当然是#include <thread>

我也尝试了以下在stackoverflow的另一个问题中发现的问题: 窗口->首选项-> C/C ++->构建->设置->发现-> CDT GCC内置编译器设置 在标题为获取编译器规格的命令"的文本框中,添加-std = c ++ 11

I tried also the following which I found in another question in stackoverflow: Window -> Preferences -> C/C++ -> Build -> Settings -> Discovery -> CDT GCC Build-in Compiler Settings in the text box entitled Command to get compiler specs append -std=c++11

现在看起来像:${COMMAND} ${FLAGS} -E -P -v -dD -std=c++11 "${INPUTS}"

属性-> C/C ++构建->设置->工具设置-> GCC C ++编译器->方言

Properties -> C/C++ Build -> Settings -> Tool Settings -> GCC C++ Compiler -> Dialect

从语言"标准下拉列表中选择ISO C ++ 11.

select ISO C++11 from the Language standard drop down.

但是它不起作用.有人可以帮忙吗?

But it does not work. Anyone can help?

更新:我将编译器更新为4.8版.该错误仍然存​​在,但是可以编译,甚至可以工作...所以对我来说足够了!谢谢大家的帮助!

UPDATE: I updated the compiler to version 4.8. The error is still there, but it compiles, and it even works... so it is enough for me! Thanks everyone for your help!

推荐答案

请注意,std=c++11标志仅在gcc 4.7中添加.尝试升级编译器,或者尝试使用gcc 4.6中支持的选项,即:std=c++0x.

Note that the std=c++11 flag was only added in gcc 4.7. Try upgrading you compiler or else try the option supported in gcc 4.6, namely: std=c++0x.

这篇关于C ++错误类型'std :: thread'无法解析Eclipse Mars 4.5,Ubuntu 12.04的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆