Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Building qt 5.15.1 static on windows using mingw



  • Hello i am trying to build the newest version of qt on windows, using mingw 8.1.0 64 bit.
    using the following batch script to build

    set OPENSSL_DIR=C:\OpenSSL-Win64
    configure -release -static -opensource -confirm-license -static-runtime -no-pch -optimize-size -v -opengl desktop -platform win32-g++ -prefix "C:\Qt\QT-Static" -skip webengine -nomake tools -nomake tests -nomake examples -openssl-linked OPENSSL_INCDIR="%OPENSSL_DIR%\include" OPENSSL_LIBDIR="%OPENSSL_DIR%\lib\VC\static" OPENSSL_LIBS="-lWs2_32 -lGdi32 -lAdvapi32 -lCrypt32 -lUser32" OPENSSL_LIBS_DEBUG="-llibssl64MDd -llibcrypto64MDd" OPENSSL_LIBS_RELEASE="-llibssl64MD -llibcrypto64MD"
    mingw32-make install
    pause
    

    C:\OpenSSL-Win64 is my installtion of https://slproweb.com/products/Win32OpenSSL.html 1.1.1g 64bit
    building on http://download.qt-project.org/official_releases/qt/5.15/5.15.1/single/.
    This is the error i get

    ERROR: Feature 'openssl-linked' was enabled, but the pre-condition '!features.securetransport && !features.schannel && libs.openssl' failed.
    

    how can i fix this? full config.log here: https://pastebin.com/9Ya7AaS1.


  • Lifetime Qt Champion

    Isn't this obvious enough?

    Trying source 1 (type inline) of library openssl ...
    Include path \\include is invalid.
    

    You have to escape the backslashes or use forward slashes



  • https://doc.qt.io/qt-5/windows-requirements.html this said i should any ways fell kinda stupid for not checking that.


  • Lifetime Qt Champion

    Now I really wonder what's going wrong since the examples also use backslashes and it works. Please try with escaping or forward slasshes, take a look in the config log if it works then and report back.



  • hm yeah that wasent the issue.
    https://pastebin.pl/view/584a030c new config

    C:\Qt\qt-everywhere-src-5.15.1-2\configure.bat -release -static -opensource -confirm-license -static-runtime -no-pch -optimize-size -opengl desktop -platform win32-g++ -prefix "C:\Qt\QT-Static" -skip webengine -nomake tools -nomake tests -nomake examples -openssl-linked OPENSSL_INCDIR="C:\OpenSSL-Win64\include" OPENSSL_LIBDIR="C:\OpenSSL-Win64\lib\VC\static" OPENSSL_LIBS="-lWs2_32 -lGdi32 -lAdvapi32 -lCrypt32 -lUser32" OPENSSL_LIBS_DEBUG="-llibssl64MDd -llibcrypto64MDd" OPENSSL_LIBS_RELEASE="-llibssl64MD -llibcrypto64MD"
    mingw32-make
    mingw32-make install
    pause
    

    new ps1 file changed to absolute paths.


  • Lifetime Qt Champion

    But now the config log output changed to undefined references to some functions. Since you're using mingw you should not use the msvc openssl libs.



  • I switched to https://bintray.com/vszakats/generic/openssl for openssl but i now have a issue(which i also had before).
    it seems that all the options cant be founde0711abf-bacc-4de5-b8f9-abe5ba5db329-image.png
    i dont know how to solve this how would i got aboudt this?



  • Update using qt-lib for every lib worked some what removing almost all the warnings just 12a44cce-bea3-4cb6-8f83-f67f07b10d43-image.png left.



  • ok fixed that with the following line

    configure.bat -release -static -opensource -confirm-license -static-runtime -qt-zlib -qt-libjpeg -qt-tiff -qt-webp -qt-libpng -qt-freetype -qt-pcre -qt-harfbuzz -gui -widgets -no-pch -opengl desktop -platform win32-g++ -prefix "C:\Qt\QT-Static-2" -skip webengine -nomake tools -nomake tests -nomake examples -openssl-linked OPENSSL_INCDIR="C:\OpenSSL-Win64\include" OPENSSL_LIBDIR="C:\OpenSSL-Win64\lib" OPENSSL_LIBS="-lWs2_32 -lGdi32 -lAdvapi32 -lCrypt32 -lUser32" OPENSSL_LIBS_DEBUG="-lssl -lcrypto" OPENSSL_LIBS_RELEASE="-lssl -lcrypto"
    

    issue is now it wont find the -lssl and -lcrypto when building the app even thoe it is there


Log in to reply