Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compile error when trying to compile a qt project

I am trying to compile my Qt project that compiles fine on a Linux machine, however on my Mac I get the following error:

    ../../Qt5.0.1/5.0.1/clang_64/include/QtCore/qlist.h:52:10: fatal error: 
  'initializer_list' file not found
   #include <initializer_list>
     ^

Any idea how to resolve this?

like image 456
EasyQuestions Avatar asked Mar 16 '13 06:03

EasyQuestions


1 Answers

This is a known bug for mac when trying to compile a Qt 5.0+ project with a 64 bit clang compiler. In order to resolve this conflict try the steps outlined in this bug fix forum post:

1) Clone the Desktop Qt 5.0.0 clang 64bit (SDK) kit.

2) Change the compiler from GCC (x86 64bit) to Clang (x86 64bit).

3) Change your project to use the cloned kit.

4) Add the following to your .pro file:

QMAKE_CXXFLAGS = -mmacosx-version-min=10.7 -std=gnu0x -stdlib=libc+

CONFIG +=c++11
like image 128
Sir Digby Chicken Caesar Avatar answered Oct 18 '22 18:10

Sir Digby Chicken Caesar