Building QtScript on Windows 7, QT 5.6.2



  • Re: :-1: erreur : Unknown module(s) in QT: script

    I've inherited a large project, I am using QT 5.6.2 (MSVC2015) on a Windows 7 machine. My predecessor used the same version of QT on Windows 10 (MSVC2013). I installed QT using the QT Maintenance Tool (rather than building from source). Since one of the projects relies heavily on QT script (which was deprecated in 5.5), it seems I need to build this module. I've come across a couple of good sources of information but I cannot get any of them to work. When I used the Maintenance Tool to obtain QT script, it downloaded into:

    C:\Qt56\5.6\Src\qtscript

    For reference, qmake.exe and the other executables are located in:

    C:\Qt56\5.6\msvc2015_64\bin

    My stumbling block appears to be, from which folder do I run the command line script from? Intuitively, I would say:

    C:\Qt56\5.6\Src\qtscript

    but there are no makefiles in that folder. I can build all of QtScript's contents from within QtCreator but that seems to be of little help.

    I've been looking at:

    http://doc.qt.io/qt-5/windows-building.html

    (Suggested to make own desktop link but script details doesn't match layout of Qt5.6.2 on my system:
    SET _ROOT=C:\qt\qt-5
    SET PATH=%_ROOT%\qtbase\bin;%_ROOT%\gnuwin32\bin;%PATH%

    Ie, there's no qtbase subfolder that I can find anywhere within my Qt installation.)

    https://stackoverflow.com/questions/31723843/how-to-build-qt-5-5-with-qtscript#31729053

    (Which directory do I build in?)


  • Lifetime Qt Champion

    Hi,

    There is no Makefile because the Qt modules are standard Qt project (except Qt base which requires a one time configuration).

    So you can indeed built the module through Qt Creator which is usually the quick and easy way, then you only have to call "nmake install" in the build folder.

    Otherwise you have to open a developer console from VS2015, setup said console for Qt development and use the classic qmake, nmake, nmake install.

    I'd recommend using a shadow build, i.e:

    mkdir c:\Qt\builddir\qtscript -p
    cd c:\Qt\builddir\qtscript
    qmake C:\Qt56\5.6\Src\qtscript
    nmake or jom
    nmake install
    


  • @SGaist Thank you for the detailed reply - just what I needed :-)

    Unfortunately, nmake fails because it cannot locate two .moc files:

    Threading.cpp
    TypeTraits.cpp
    Generating Code...
            cl -c -FIQtScriptDepends -YuQtScriptDepends -Fp.pch\release\Qt5Script_pch.pch -nologo -Zc:wchar_t -FS -Zc:strictStrings -Z
    c:throwingNew -wd4291 -wd4344 -wd4396 -wd4503 -wd4800 -wd4819 -wd4996 -wd4396 -wd4099 -O2 -MD -D_HAS_EXCEPTIONS=0 -GR -DUNICODE -D
    WIN32 -DJSC=QTJSC -Djscyyparse=qtjscyyparse -Djscyylex=qtjscyylex -Djscyyerror=qtjscyyerror -DWTF=QTWTF -DQT_NO_USING_NAMESPACE -D
    QLALR_NO_QSCRIPTGRAMMAR_DEBUG_INFO -DBUILDING_QT__=1 -DWTF_USE_ACCELERATED_COMPOSITING -DUSE_SYSTEM_MALLOC -DNDEBUG -DLOG_DISABLED
    =1 -DBUILDING_QT__ -DBUILDING_JavaScriptCore -DBUILDING_WTF -DNOMINMAX -D_CRT_RAND_S -DWTF_USE_JAVASCRIPTCORE_BINDINGS=1 -DWTF_CHA
    NGES=1 -DJS_NO_EXPORT -DQT_BUILD_SCRIPT_LIB -DQT_BUILDING_QT -D_CRT_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES -DQT_NO_CAST_TO_ASCII -
    DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -
    DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_CORE_LIB -D_WINDLL -IC:\qt56\5.6\Src\qtscript\src\script -I. -IC:\qt56\5.6\Src\qtscript\src\3
    rdparty\javascriptcore\JavaScriptCore -IC:\qt56\5.6\Src\qtscript\src\3rdparty\javascriptcore -IC:\qt56\5.6\Src\qtscript\src\3rdpar
    ty\javascriptcore\JavaScriptCore\assembler -IC:\qt56\5.6\Src\qtscript\src\3rdparty\javascriptcore\JavaScriptCore\bytecode -IC:\qt5
    6\5.6\Src\qtscript\src\3rdparty\javascriptcore\JavaScriptCore\bytecompiler -IC:\qt56\5.6\Src\qtscript\src\3rdparty\javascriptcore\
    JavaScriptCore\debugger -IC:\qt56\5.6\Src\qtscript\src\3rdparty\javascriptcore\JavaScriptCore\interpreter -IC:\qt56\5.6\Src\qtscri
    pt\src\3rdparty\javascriptcore\JavaScriptCore\jit -IC:\qt56\5.6\Src\qtscript\src\3rdparty\javascriptcore\JavaScriptCore\parser -IC
    :\qt56\5.6\Src\qtscript\src\3rdparty\javascriptcore\JavaScriptCore\pcre -IC:\qt56\5.6\Src\qtscript\src\3rdparty\javascriptcore\Jav
    aScriptCore\profiler -IC:\qt56\5.6\Src\qtscript\src\3rdparty\javascriptcore\JavaScriptCore\runtime -IC:\qt56\5.6\Src\qtscript\src\
    3rdparty\javascriptcore\JavaScriptCore\wrec -IC:\qt56\5.6\Src\qtscript\src\3rdparty\javascriptcore\JavaScriptCore\wtf -IC:\qt56\5.
    6\Src\qtscript\src\3rdparty\javascriptcore\JavaScriptCore\wtf\symbian -IC:\qt56\5.6\Src\qtscript\src\3rdparty\javascriptcore\JavaS
    criptCore\wtf\unicode -IC:\qt56\5.6\Src\qtscript\src\3rdparty\javascriptcore\JavaScriptCore\yarr -IC:\qt56\5.6\Src\qtscript\src\3r
    dparty\javascriptcore\JavaScriptCore\API -IC:\qt56\5.6\Src\qtscript\src\3rdparty\javascriptcore\JavaScriptCore\ForwardingHeaders -
    IC:\qt56\5.6\Src\qtscript\src\3rdparty\javascriptcore\JavaScriptCore\generated -IC:/qt56/5.6/Src/qtscript/src/3rdparty/javascriptc
    ore/WebKit/qt/Api -IC:\qt56\5.6\Src\qtscript\src\3rdparty\javascriptcore\JavaScriptCore\pcre -IC:/qt56/5.6/Src/qtscript/src/3rdpar
    ty/javascriptcore/JavaScriptCore/tmp -IC:\qt56\5.6\Src\qtscript\src\script -IC:\qt56\5.6\Src\qtscript\src\script\parser -IC:\qt56\
    5.6\Src\qtscript\include -IC:\qt56\5.6\Src\qtscript\include\QtScript -I..\..\include -I..\..\include\QtScript -IC:\qt56\5.6\Src\qt
    script\include\QtScript\5.6.2 -IC:\qt56\5.6\Src\qtscript\include\QtScript\5.6.2\QtScript -Itmp -IC:\Qt56\5.6\msvc2015_64\include\Q
    tCore\5.6.2 -IC:\Qt56\5.6\msvc2015_64\include\QtCore\5.6.2\QtCore -IC:\Qt56\5.6\msvc2015_64\include -IC:\Qt56\5.6\msvc2015_64\incl
    ude\QtCore -I.moc\release -IC:/utils/my_sql/my_sql/include -IC:/utils/postgresql/pgsql/include -IC:\Qt56\5.6\msvc2015_64\mkspecs\w
    in32-msvc2015  -Foobj\release\release\ @C:\Users\ckd27546\AppData\Local\Temp\nmFA31.tmp
    MainThreadQt.cpp
    C:\qt56\5.6\Src\qtscript\src\3rdparty\javascriptcore\JavaScriptCore\wtf\qt\MainThreadQt.cpp(74): fatal error C1083: Cannot open in
    clude file: 'MainThreadQt.moc': No such file or directory
    ThreadingQt.cpp
    C:\qt56\5.6\Src\qtscript\src\3rdparty\javascriptcore\JavaScriptCore\wtf\qt\ThreadingQt.cpp(295): fatal error C1083: Cannot open in
    clude file: 'ThreadingQt.moc': No such file or directory
    Generating Code...
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.EXE"' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe"' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.
    

  • Lifetime Qt Champion

    Building from the console or through Qt Creator ?

    Did you use the sources from the installer or did you clone them with git ?



  • Sorry, I did get it working by compiling through QtCreator then running the nmake install step from the cmd prompt as outlined. Took a couple of tries. Not used why it was fine within QtCreator but not from the cmd line but I got it working so I'm happy.

    I later tried the same step in 5.9.2 - only needed to use the upgrade tool and download. No need to build/install, so cheers for making it so seamless :-)

    Can I mark this thread as "solved" or is that a job for the forum moderator?


  • Lifetime Qt Champion

    No it's not, you can mark your thread as solved.

    All the same you can vote for any answer you find useful on any of the threads.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.