Qt – ERROR: Unknown module(s) in QT: script when building Qt Creator

qtqt-creator

I have build Qt from source and now I am trying to build Qt Creator from source and get the following error: Project ERROR: Unknown module(s) in QT: script. I found a similar thread that suggested building qtscript library by running make module-qtscript manually. I did that from the Qt source folder and the build for the script library finished without any errors. However, I still get the same error when I try to prepare Qt Creator for build:


$ 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

Locating libQt5Script.so finds it in my Qt source directory but not installed anywhere else on the system:


$ 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

Here is my Qt version:

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

I am following this guide. What else do I need to do to get past this error and build Qt Creator?

Edit2
Here is my config.status file:

:~/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 "$@"

Best Answer

  1. You seem to be building Qt in its source folder. That's a bad idea since you have to recreate the source folder each time you attempt a clean rebuild.

    Delete your qt-everywhere-opensource-src-5.7.0 folder and decompress it from the .tar.xz file.

  2. Create a separate build folder, e.g.

    mkdir -p ~/Projects/5.7.0-shared-build
    
  3. Configure for your prefix:

    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. Build

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