Search code examples
c++multithreadingcodeblocksprecompiling

Error: 'thread' in namespace 'std' does not name a type


I have an error on my compile

Picture Of The Error

I tried to fix it by downloading and installing gcc-tdm, because a forum mentioned this is a compiler issue, but I am still getting the same result.

Does anyone know how to solve this?


Solution

  • The version of GCC that CodeBlocks ships with doesn't support threads (or at least it was the case last time I checked). You'll have to install a better compiler, and configure CB to use it.

    You can get a fresh version of GCC from MSYS2. Or you can install one of the numerous MinGW-w64 distributions.