错误:QT中的未知模块:构建Qt Creator时的脚本

时间:2016-08-16 19:53:43

标签: qt qt-creator

我已经从源代码构建了Qt,现在我正在尝试从源代码构建Qt Creator并得到以下错误:Project ERROR: Unknown module(s) in QT: script。我发现a similar thread建议通过手动运行make module-qtscript来构建qtscript库。我是从Qt源文件夹中完成的,并且脚本库的构建完成没有任何错误。但是,当我尝试为构建准备Qt Creator时,我仍然遇到同样的错误:

$ qmake -r ../qt-creator/qtcreator.pro Reading /home/aras/Projects/qt-creator/src/src.pro [/home/aras/Projects/qt-creator-build/src] Reading /home/aras/Projects/qt-creator/src/shared/qbs/src/lib/corelib/corelib.pro [/home/aras/Projects/qt-creator-build/src/shared/qbs/src/lib/corelib] Project ERROR: Unknown module(s) in QT: script

找到libQt5Script.so在我的Qt源目录中找到它但未安装在系统上的任何其他位置:

$ locate libQt5Script.so /home/aras/Projects/qt-everywhere-opensource-src-5.7.0/qtbase/lib/libQt5Script.so /home/aras/Projects/qt-everywhere-opensource-src-5.7.0/qtbase/lib/libQt5Script.so.5 /home/aras/Projects/qt-everywhere-opensource-src-5.7.0/qtbase/lib/libQt5Script.so.5.7 /home/aras/Projects/qt-everywhere-opensource-src-5.7.0/qtbase/lib/libQt5Script.so.5.7.0 这是我的Qt版本:

$ qmake -v
QMake version 3.0
Using Qt version 5.7.0 in /usr/local/Qt-5.7.0/lib

我关注this guide。我还需要做些什么来克服这个错误并构建Qt Creator?

EDIT2 这是我的config.status文件:

:~/Projects/shared-build-qt5.7.0$ cat qtbase/config.status 
#!/bin/sh
/home/aras/Projects/qt-everywhere-opensource-src-5.7.0/qtbase/configure -prefix /usr/local/Qt-5.7.0 -opensource -confirm-license -debug-and-release "$@"

1 个答案:

答案 0 :(得分:1)

  1. 您似乎在其源文件夹中构建Qt。这是一个坏主意,因为每次尝试干净重建时都必须重新创建源文件夹。

    删除qt-everywhere-opensource-src-5.7.0文件夹并从.tar.xz文件解压缩。

  2. 创建单独的构建文件夹,例如

    mkdir -p ~/Projects/5.7.0-shared-build
    
  3. 配置前缀:

    cd ~/Projects/5.7.0-shared-build
    ~/Projects/qt-everywhere-opensource-src-5.7.0/configure \
      -prefix /usr/local/Qt-5.7.0 \
      -opensource -confirm-license \
      -debug-and-release \
      -nomake examples
    
  4. 构建

    make -j8 && make -j8 install && echo 'SUCCESS!'