Qt 5.2.1无法在mac OSX 10.8.5上构建

时间:2014-03-06 22:39:16

标签: c++ macos qt build qt5

我在运行OS X 10.8.5并使用xcode 5.0.2的Macbook上下载了Qt 5.2.1(.tar.gz),解压缩并运行此配置:

./configure -prefix $PWD/qtbase -debug-and-release -developer-build -no-c++11 -opensource -plugin-sql-sqlite -qtlibinfix _fmosoft -nomake tests -skip qtwebkit -skip qtwebkit-examples -no-compile-examples

我有几个补丁要添加到Qt5.2.1,所以我不能只安装二进制文件。但我认为我首先尝试在没有任何补丁的情况下构建,只需使用解压缩的代码和我的配置选项。配置成功,然后我运行

make

运行大约5分钟,然后给我这个错误:

../corelib/global/qt_pch.h:58:10: error: 'qglobal.h' file not found with
      <angled> include; use "quotes" instead
#include <qglobal.h>
         ^~~~~~~~~~~
         "qglobal.h"
../corelib/global/qt_pch.h:64:10: fatal error: 'qcoreapplication.h' file not
      found
#include <qcoreapplication.h>
         ^
2 errors generated.
make[4]: *** [.pch/debug/QtNetwork_fmosoft_debug/c++.pch] Error 1
make[3]: *** [debug-all] Error 2
make[2]: *** [sub-network-make_first] Error 2
make[1]: *** [sub-src-make_first] Error 2
make: *** [module-qtbase-make_first] Error 2

我做错了什么?如何在我的Macbook上构建Qt5.2.1?

1 个答案:

答案 0 :(得分:1)

前缀是安装前缀,它指向构建目录中的qtbase文件夹是没有意义的。构建目录是您必须调用configure的地方。

以下对我有用(从{X}的实际构建中从.bash_history转储):

mkdir $HOME/Qt/build-5.2.1
cd $HOME/Qt/build-5.2.1
~/Qt5.2.1/5.2.1/Src/configure -prefix "$HOME/Qt/5.2.1" -debug-and-release \
  -no-pkg-config -opensource -confirm-license -optimized-qmake \
  -nomake examples
make -j2
make install

make install之后,您将其安装到$HOME/Qt/5.2.1。这就是前缀。