PDA

View Full Version : [SOLVED] C++11 GNU Issue with cmake



andamaru
April 27th, 2014, 05:08 PM
I'm writing an application and I'm using cmake and a few features from C++11, when I compile my application I get this error:



Thisfilerequirescompilerandlibrarysupportforthe\IS OC++2011standard.Thissupportiscurrentlyexperimenta l,andmustbe\enabledwiththe-std=c++11or-std=gnu++11compileroptions.

I've added that option to cmake but I'm still getting the issue. What is the correct way to add it?



cmake_minimum_required(VERSION2.8)
project(sky-network)

add_definitions(-DBUILDING_DLL)

if(CMAKE_COMPILER_IS_GNUCXX)
add_definitions(-std=c++11)
endif()


I'm on Ubuntu 14.04 using QT Creator, everything is from their repo.

andamaru
April 27th, 2014, 11:25 PM
I found the solution at this web site:

http://stackoverflow.com/questions/15100351/changing-cmake-cxx-flags-in-project