Important: Please read the 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

    C:\OpenSSL-Win64 is my installtion of 1.1.1g 64bit
    building on
    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:

  • 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

  • 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. 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 install

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