Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. how to statically compile Qt using MinGW compiler and SSL support
QtWS25 Last Chance

how to statically compile Qt using MinGW compiler and SSL support

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
qt 5sslopensslqmakestatic build
4 Posts 4 Posters 1.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • CybeXC Offline
    CybeXC Offline
    CybeX
    wrote on last edited by
    #1

    How to statically compile Qt with OpenSSL support on Windows (with MinGW compiler)
    The desired 'outcome' of this Qt build is to build and ship a portable Qt application with built-in SSL support.

    So this is an age old problem with a multitude of questions on this topic, yet very few solutions exist that solves the problem. Some of these questions (and problems):

    • QT https SSL support for static QT static program build - getting 'Protocol “https” is unknown'
    • about compiling openssl inside qt application
    • Build Qt static from source enabling OpenSSL support
    • Compile static version of QT + OpenSSL Support
    • how to compile qt static with open ssl
    • Compiling static for Windows with OpenSSL

    there are many more

    and some of my own questions (using OpenSSL v1.1.1d & Qt 5.13 with MinGW ):

    • Statically compiled Qt 5.13.1 with OpenSSL 1.1.1d producing QSslSocket::connectToHostEncrypted: TLS initialization failed
    • Create a standalone binary using Qt with OpenSSL support
    • Static OpenSSL *.a libraries not linked target binary (using Statically Compiled Qt with SSL)
    • Static compile Qt 5.13.1 with -openssl-linked using MinGW (Windows 10)

    Most of these questions do not have answers, and those answers provided (obviously) did not help in compiling, due to some error output or simply OpenSSL was never linked (built into the portable/binary application), or many other errors.

    Further, there appears to be alot of confusion about using -ssl, -openssl-linked, -openssl and what each means. Also, if one should use -L/path/to/libs/static -l library1 -l library2 vs using the OPENSSL_HOME env variable and specify the path to headers & static / linked libraries, etc

    Please note:

    Ideally, in compiling, specific instructions for libraries would be required such as OpenSSL v1.0.2 or OpenSSL v1.1 and the qmake arguments in building a static Qt with those specific libraries in addition to things that should be considered during the build process.

    What does Qt say?

    Qt has provide some help in the form of these 2 posts:

    • Building a static Qt for Windows using MinGW with a Powershell script which does compile Qt statically using MinGW, but adding the various combinations (and permutations) of OpenSSL libraries -l and/or -L to the various paths (.lib), (.a), header files, etc simply did not work
    • Compiling OpenSSL with MinGW

    The aim of this question is to give a detailed explanation and step-wise method in allowing those who need to compile a static Qt version with SSL some support and direction.

    This is an unnatural "question", but having seen so many questions with no/very few solutions for cherrypicked cases in each specific question makes a general solution very difficult to obtain.

    I am posting this question in hopes of a general solution being made available that could benefit all.

    1 Reply Last reply
    2
    • H Offline
      H Offline
      HankLA
      wrote on last edited by
      #2

      Qt developers team ignore questions about static linking at all. In 5.15 and 6 it's almost broken for linux. You need to provide additional libs with static app. lol

      jsulmJ 1 Reply Last reply
      0
      • H HankLA

        Qt developers team ignore questions about static linking at all. In 5.15 and 6 it's almost broken for linux. You need to provide additional libs with static app. lol

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @HankLA said in how to statically compile Qt using MinGW compiler and SSL support:

        Qt developers team

        This is user forum driven mainly by volunteers, not Qt developers forum.
        To contact Qt developers use their mailing list and/or Qt bug tracker.

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • G Offline
          G Offline
          Giovanni R
          wrote on last edited by
          #4

          i am facing the same nightmare. it's 2weeks i'm stuck tryin' to obtain my static +openssl build and...no way.

          No issues compiling without openssl support.

          Any progress on that? Seems that nobody wants to help :(

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved