简体   繁体   English

用Qt5编译的Qt3D失败了

[英]Qt3D compile with Qt5 failed

I'm having troubles compiling Qt3D on Windows. 我在Windows上编译Qt3D时遇到了麻烦。 The module compiles and links properly on my Linux machine with Qt 4.8.1. 该模块使用Qt 4.8.1在我的Linux机器上正确编译和链接。 Though on Windows (Qt 5.2 personal build) g++ says <Qt3D/qt3dglobal.h> header is not found. 虽然在Windows(Qt 5.2个人版本)上g ++说<Qt3D/qt3dglobal.h>标题未找到。

I've compiled qt3d on linux with following these steps: 我已经在linux上编译了qt3d并执行了以下步骤:

  1. Download a tarball of branch qt4 from here , extract it. 这里下载分支qt4的tarball,解压缩。
  2. qmake CONFIG+=package qmake CONFIG + =包
  3. make -j4 make -j4
  4. sudo make install sudo make install

And for Windows (Qt 5.2 gcc-4.8.1 personal build): 对于Windows(Qt 5.2 gcc-4.8.1个人版):

  1. Download tarball of master branch from here , extract it 这里下载master branch的tarball,解压缩
  2. qmake QMAKE
  3. make // => error: missing headers make // =>错误:缺少标题

What I'm missing? 我错过了什么?

Note: ActiveState Perl is in PATH 注意:ActiveState Perl位于PATH中

I was able to reproduce this error - I guess its a bug as Qt3D used to build like this. 我能够重现这个错误 - 我猜它是一个错误,因为Qt3D曾经像这样构建。 But the Qt folks are probably used to building Qt3D as part of the modular Qt build . 但Qt人员可能习惯于将Qt3D 构建为模块化Qt构建的一部分 My guess is that some part of the qmake step which is meant to set up the header paths is not working on Windows. 我的猜测是,用于设置标题路径的qmake步骤的某些部分在Windows上不起作用。

I got it to build by copying the headers manually: 我通过手动复制标题来构建它:

# in git bash
mkdir Qt3D
find qt-qt3d/ -name "*.h" -exec cp \{} Qt3D/. \;
mkdir qt-qt3d/include
mv Qt3D qt-qt3d/include/.

Then: 然后:

# in VS2012 shell
set PATH=%PATH%;%HOMEPATH%\build\qt5\bin
mkdir qt3d_build
cd qt3d_build
qmake ..\qt-qt3d\qt3d.pro
nmake

Here Qt and qt-qt3d were in the current directory (in qt5 and qt-qt3d respectively) and Qt was built from source already. 这里Qt和qt-qt3d在当前目录中(分别在qt5和qt-qt3d中),Qt是从源代码构建的。

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

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