简体   繁体   English

尝试编译qt项目时编译错误

[英]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: 我正在尝试编译我在Linux机器上编译好的Qt项目,但是在我的Mac上我收到以下错误:

    ../../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? 知道如何解决这个问题吗?

This is a known bug for mac when trying to compile a Qt 5.0+ project with a 64 bit clang compiler. 当尝试使用64位clang编译器编译Qt 5.0+项目时,这是mac的一个已知错误。 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. 1)克隆桌面Qt 5.0.0 clang 64bit(SDK)工具包。

2) Change the compiler from GCC (x86 64bit) to Clang (x86 64bit). 2)将编译器从GCC(x86 64位)更改为Clang(x86 64位)。

3) Change your project to use the cloned kit. 3)更改项目以使用克隆的工具包。

4) Add the following to your .pro file: 4)将以下内容添加到.pro文件中:

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

CONFIG +=c++11

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM