Skip to main content
edited tags
Link
ildjarn
  • 63.2k
  • 9
  • 135
  • 219
Source Link
Hellhound
  • 531
  • 2
  • 9
  • 21

How to activate c++11 support on MinGW using CMake?

I've installed latest version of MinGW/MSYS environment. Now I try to activat c++11 standard support. I've added to my cmake script:

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=gnu++0x") 

If I try to build a simple test. I got the following compile failure:

error: 'shared_ptr' is not a member of 'std' 

It seems to me that c++11 support is not set. If I remove the std::shared_ptr declaration from my code and try to compile some code of the chrono library it works. This confuses me. Why some c++11 libraries are supported but core elements like shared_ptr fails?

Do I need to do something extra to enable smart pointers or they are just not there?