Solved Build Static Qt fails with Project Error
-
Hello , im trying to build a static Qt on windows 10 but i get the following error. i have to mention though that Python 2.7 is on my env path. Can anyone help me with this ?
ImportError: No module named site Project ERROR: Building QtQml requires Python. Makefile:342: recipe for target 'module-qtdeclarative-install_subtargets' failed mingw32-make: *** [module-qtdeclarative-install_subtargets] Error 3 mingw32-make: Target 'install' not remade because of errors. Press Enter to continue...:
-
Hi,
Check this Stack Overflow thread, your issue seems similar.
-
@SGaist ok it seems i have managed to define the environmental variables correctly but the build process takes forever.. too many hours and still going..
-
Are you using all your computer's processors for the build ?
-
@SGaist not sure , ive just used info from this site https://wiki.qt.io/Building_a_static_Qt_for_Windows_using_MinGW and choosed the powershell option.. Then i did some modifications to the powershell script in order to include openssl paths into build process according to this thread https://forum.qt.io/topic/94328/qt-static-with-openssl-issue/20 .. don't know got a bit lost , any help would be appreciated..
-
What version of python 2.7 are you using ?
-
@SGaist im back.. So im trying to find my steps around static building and luckily i think im in the right way... no prob with python anymore as well as perl as they are all in the right path now.. regarding your question, im using python 2.7.15 version but this is not the case. Anyway, many things arising that require specific knowledge as for example the OpenSSL lib which i want to use in my project... So what i did is the following.. i took the powershell script from here https://wiki.qt.io/Building_a_static_Qt_for_Windows_using_MinGW and i did some modifications.. for example i have changed the configuration process as follows
cmd /c "configure -static -debug-and-release -opensource -confirm-license -ssl -openssl -openssl-linked -opengl desktop -platform win32-g++ -prefix $QtDir -no-compile-examples -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -qt-sqlite -webengine-pepper-plugins -webengine-proprietary-codecs -make libs -nomake tools -nomake examples -nomake tests -I 'C:\OpenSSL-Win32\include' -L 'C:\OpenSSL-Win32\lib\VC\static' OPENSSL_LIBS="" -lUser32 -lAdvapi32 -lGdi32 -lCrypt32"" OPENSSL_LIBS_DEBUG="" -lssleay32MTd -llibeay32MTd"" OPENSSL_LIBS_RELEASE=""-lssleay32MT -llibeay32MT"" "
When all the above finish the building process will continue using the two following commands
mingw32-make -k -j8 mingw32-make -k install
the -j8 option indicates that there will be multiple parallel jobs in compilation process....
before running the script i have created the following batch script qt5vars.bat to run before all other scripts in order to create the environment in Windows 10
@echo off REM Set up \Microsoft Visual Studio 2015, where <arch> is \c amd64, \c x86, etc. CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 REM Edit this location to point to the source code of Qt SET _ROOT=C:\Qt\Static5113\src\qt-everywhere-src-5.11.3 SET PATH=%_ROOT%\qtbase\bin;%_ROOT%\gnuwin32\bin;%PATH% REM Uncomment the below line when using a git checkout of the source repository REM SET PATH=%_ROOT%\qtrepotools\bin;%PATH% REM Uncomment the below line when building with OpenSSL enabled. If so, make sure the directory points REM to the correct location (binaries for OpenSSL). SET PATH=C:\OpenSSL-Win32\bin;%PATH% REM When compiling with ICU, uncomment the lines below and change <icupath> appropriately: REM SET INCLUDE=<icupath>\include;%INCLUDE% REM SET LIB=<icupath>\lib;%LIB% REM SET PATH=<icupath>\lib;%PATH% REM uncomment the following line to use multiple cores on compile time SET CL=/MP REM Contrary to earlier recommendations, do NOT set QMAKESPEC. SET _ROOT= REM Keeps the command line open when this script is run. cmd /k
The run.bat script has been taken from here https://www.youtube.com/watch?v=lwX_urJJOf8
Anywayz... after all the above the building process still takes forever and eventually fails as well as it also cannot check for OpenSSL libs which i have included them inside the scripts
Why there is not a straight forward working process for all these ? ? Why we have to go to through all this pain and time consuming process in order to do one static build in Qt ?
-
ok build finished with errors
mingw32-make: Target 'install' not remade because of errors.
now what ... . ?
-
[.......] 1 file(s) copied. C:\Qt\Static5113\src\qt-everywhere-src-5.11.3\qtbase\bin\qmake.exe -install qinstall C:\Qt\Static5113\src\qt-everywhere-src-5.11.3\qtsvg\lib\cmake\Qt5Svg\Qt5Svg_QSvgIconPlugin.cmake C:\Qt\Static5113\5.11.3_Static\lib\cmake\Qt5Svg\Qt5Svg_QSvgIconPlugin.cmake mingw32-make[6]: Leaving directory 'C:/Qt/Static5113/src/qt-everywhere-src-5.11.3/qtsvg/src/plugins/iconengines/svgiconengine' C:/Qt/Tools/mingw530_32/bin/mingw32-make -f Makefile.Release install mingw32-make[6]: Entering directory 'C:/Qt/Static5113/src/qt-everywhere-src-5.11.3/qtsvg/src/plugins/iconengines/svgiconengine' C:\Qt\Static5113\src\qt-everywhere-src-5.11.3\qtbase\bin\qmake.exe -install qinstall C:\Qt\Static5113\src\qt-everywhere-src-5.11.3\qtsvg\mkspecs\modules-inst\qt_plugin_qsvgicon.pri C:\Qt\Static5113\5.11.3_Static\mkspecs\modules\qt_plugin_qsvgicon.pri C:\Qt\Static5113\src\qt-everywhere-src-5.11.3\qtbase\bin\qmake.exe -install sed -e "s,C:/Qt/Static5113/src/qt-everywhere-src-5.11.3/[^/][^/]*/lib,$$[QT_INSTALL_LIBS],g" -e "s,C:\\\\Qt\\\\Static5113\\\\src\\\\qt-everywhere-src-5.11.3\\\[^\\\][^\\\]*\\\\lib,$$[QT_INSTALL_LIBS],gi" ..\..\..\..\plugins\iconengines\qsvgicon.prl > C:\Qt\Static5113\5.11.3_Static\plugins\iconengines\qsvgicon.prl copy /y ..\..\..\..\plugins\iconengines\libqsvgicon.a C:\Qt\Static5113\5.11.3_Static\plugins\iconengines\libqsvgicon.a 1 file(s) copied. C:\Qt\Static5113\src\qt-everywhere-src-5.11.3\qtbase\bin\qmake.exe -install qinstall C:\Qt\Static5113\src\qt-everywhere-src-5.11.3\qtsvg\lib\cmake\Qt5Svg\Qt5Svg_QSvgIconPlugin.cmake C:\Qt\Static5113\5.11.3_Static\lib\cmake\Qt5Svg\Qt5Svg_QSvgIconPlugin.cmake mingw32-make[6]: Leaving directory 'C:/Qt/Static5113/src/qt-everywhere-src-5.11.3/qtsvg/src/plugins/iconengines/svgiconengine' mingw32-make[5]: Leaving directory 'C:/Qt/Static5113/src/qt-everywhere-src-5.11.3/qtsvg/src/plugins/iconengines/svgiconengine' mingw32-make[4]: Leaving directory 'C:/Qt/Static5113/src/qt-everywhere-src-5.11.3/qtsvg/src/plugins/iconengines' mingw32-make[3]: Leaving directory 'C:/Qt/Static5113/src/qt-everywhere-src-5.11.3/qtsvg/src/plugins' mingw32-make[2]: Leaving directory 'C:/Qt/Static5113/src/qt-everywhere-src-5.11.3/qtsvg/src' mingw32-make[1]: Leaving directory 'C:/Qt/Static5113/src/qt-everywhere-src-5.11.3/qtsvg' mingw32-make: Target 'install' not remade because of errors. Press Enter to continue...:
@SGaist Any suggestions ?
-
@xenovas said in Build Static Qt fails with Project Error:
mingw32-make: Target 'install' not remade because of errors
i was wondering if there is no need to worry about this error ...?
-
Well, if there's an error somewhere, better fix it. However you don't show said error in what you posted.
-
Yes you are right.. Anyway i finally made it !!! i have a standalone exe running .. ! Static build is done Yeah Wooohoo.. Thanks @SGaist
-
@SGaist i also have OpenSSL included to my projects now !
-
Ok and for those who want to know how to include OpenSSL lib and headers to their projects
add the following lines to your .pro file in your project
LIBS += -LC:/OpenSSL-Win32/lib -lssleay32 INCLUDEPATH += C:/OpenSSL-Win32/include