Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding QMAKE_CXXFLAGS += -std=c++11 to .pro file in qt not working(on linux 12.04)

Tags:

c++

gcc

c++11

qt

qmake

Compiler output:

[main.o] Error 1

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

like image 710
user3466884 Avatar asked Nov 01 '22 02:11

user3466884


1 Answers

The solution is to update your ancient gcc version on the system. In fact, I am quite surprised that you have such an old version on your 12.04 Ubuntu variant. It should have 4.6.3 by deault.

What you could try is c++0x instead of c++11 and see if that makes it work. You could also fire up the gcc manual by issuing man gcc and look for the precise option.

Also, while we are it, you could probably simply write this in your qmake project file instead of such raw configurations:

CONFIG += c++11
like image 123
lpapp Avatar answered Nov 11 '22 09:11

lpapp