std::thread not available but dialect set to C++11

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

std::thread not available but dialect set to C++11

472 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by davidviranyi on Mon Jan 25 04:52:51 MST 2016
I am try to use std::thread in a project. I have set the dialect to c++11 and also tried c++1y. I get an error message that thread is not a member of std.

When I look at the thread header file I see it tests the value of __cplusplus which is 199711L and so excludes the declaration of thread.

Surely this value should be set to 201103L if the dialect is set to c++11 ?
0 Kudos
2 Replies

377 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Mon Jan 25 06:23:00 MST 2016
In addition to libraries, GCC itself also needs to be built with threading support turned on:

https://gcc.gnu.org/install/configure.html

The "GCC ARM Embedded"  distribution that the LPCXpresso IDE uses is not build with this option.

Regards,
LPCXpresso Support
0 Kudos

377 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by vtw.433e on Mon Jan 25 06:10:35 MST 2016
For thread support, you need a C++ runtime that supports threads. That will rely on having on RTOS, or you having to add thread support into the runtime yourself. i.e. it won't work on 'bare metal' systems.
0 Kudos