2

I am quite desperate. Eclipse keeps on giving the error

'std::thread' could not be resolved

I of course #include <thread>

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

NOW it looks like: ${COMMAND} ${FLAGS} -E -P -v -dD -std=c++11 "${INPUTS}"

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

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

But it does not work. Anyone can help?

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!

Cristina
  • 21
  • 1
  • 5

2 Answers2

1

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.

nbubis
  • 2,304
  • 5
  • 31
  • 46
0

Had the same problem with eclipse oxygen. Removing support for pthread in the linker and compiler solved it for me.

Undo
  • 25,519
  • 37
  • 106
  • 129
haim
  • 1
  • 1