Open mvitez opened 9 years ago
Sorry, that change only works with CMake 3.1 Add this instead, but this will only work for gcc: set(CMAKE_CXX_FLAGS "-std=c++11")
Thank you very much for the solutions. I will update it as soon as possible.
+1 for including this, I have the same problem without modifying CMakeLists.txt
.
Or, add the following line in CMakeLists file add_definitions(-std=c++11)
P.S., Both does the same job. This is just what i prefer ;)
Or: set (CMAKE_CXX_STANDARD 11)
Trying to compile this code under Linux with g++ 4.8.2 fails, because your code uses C++ 11 features. So adding these two lines to CMakeLists.txt fixes the problem: set_property(TARGET TrainDemo.out PROPERTY CXX_STANDARD 11) set_property(TARGET TestDemo.out PROPERTY CXX_STANDARD 11)