Tuesday, November 19, 2013

Solution to cc1plus: error: unrecognized command line option ‘-std=c++11’

If you get an error like this

cc1plus: error: unrecognized command line option ‘-std=c++11’

Then 

Step 1 : Update your gcc/g++ compiler to the latest version

Step 2 :

Change the line 

SET( CMAKE_CXX_FLAGS         "-std=c++11 -Wall -Wno-deprecated -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-narrowing -DUNIX_ENVIRONMENT -DHAVE_NAMESPACES -DHAVE_STD " )


SET( CMAKE_CXX_FLAGS         "-std=c++11 -Wall " )

SET( CMAKE_CXX_FLAGS         "-Wno-deprecated -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-narrowing -DUNIX_ENVIRONMENT -DHAVE_NAMESPACES -DHAVE_STD " )


Hope this solve the issue.

If it doesnt,
 then 

Step 3 : GOOGLE :)

No comments:

Post a Comment