Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to set QSsl for static build
Forum Updated to NodeBB v4.3 + New Features

How to set QSsl for static build

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 728 Views 2 Watching
  • 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.
  • P Offline
    P Offline
    pjorgegerman
    wrote on 4 Oct 2019, 13:50 last edited by
    #1

    Hi, I´m still a rookie in Qt programming, also I´m not a native English speaker, so before I start I apologize for all my ignorance.
    I need to deploy a Qt aplication on windows that uses QSslConfiguration library, I did a static compilation of Qt 5.3.0 based on a guide I found in this link https://wiki.qt.io/Building_a_static_Qt_for_Windows_using_MinGW, now when I compile the application it gives me the following error:

    error: variable 'QSslConfiguration config' has initializer but incomplete type
    QSslConfiguration config = QSslConfiguration::defaultConfiguration();
    ^

    I really need help, I´m still not familiarized with many of the conpcepts that static building involves.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 4 Oct 2019, 14:03 last edited by mrjj 10 Apr 2019, 14:03
      #2

      Hi and welcome to the forums

      Did you see
      https://stackoverflow.com/questions/20843180/is-there-any-way-to-building-static-qt-with-static-openssl

      Seems you must use
      -openssl-linked

      when compiling Qt.

      ps. your english is fine :)

      P 1 Reply Last reply 4 Oct 2019, 14:08
      0
      • M mrjj
        4 Oct 2019, 14:03

        Hi and welcome to the forums

        Did you see
        https://stackoverflow.com/questions/20843180/is-there-any-way-to-building-static-qt-with-static-openssl

        Seems you must use
        -openssl-linked

        when compiling Qt.

        ps. your english is fine :)

        P Offline
        P Offline
        pjorgegerman
        wrote on 4 Oct 2019, 14:08 last edited by
        #3

        @mrjj so should I pass by all the compilation process all over again? or is there any workaround, I saw the stackoverflow question but really didn´t understand where to put the -openssl-linked line

        I gues that I should modify the windows-build-qt-static.ps1 script and in the next line:
        cmd /c "configure.bat -static -debug-and-release -platform win32-g++ -prefix $QtDir -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -qt-sql-sqlite -no-openssl
        -opensource -confirm-license `
        -make libs -nomake tools -nomake examples -nomake tests"

        and replace -no-openssl by -openssl-linked, I´m I rigth?

        M 1 Reply Last reply 4 Oct 2019, 14:26
        0
        • P pjorgegerman
          4 Oct 2019, 14:08

          @mrjj so should I pass by all the compilation process all over again? or is there any workaround, I saw the stackoverflow question but really didn´t understand where to put the -openssl-linked line

          I gues that I should modify the windows-build-qt-static.ps1 script and in the next line:
          cmd /c "configure.bat -static -debug-and-release -platform win32-g++ -prefix $QtDir -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -qt-sql-sqlite -no-openssl
          -opensource -confirm-license `
          -make libs -nomake tools -nomake examples -nomake tests"

          and replace -no-openssl by -openssl-linked, I´m I rigth?

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 4 Oct 2019, 14:26 last edited by
          #4

          @pjorgegerman
          Hi
          yes, you are right.
          and also install
          Win32 OpenSSL v1.0.2L
          or what fits your Qt version.
          Qt 5.3 is pretty old so make sure its the right ssl version.

          1 Reply Last reply
          0
          • P Offline
            P Offline
            pjorgegerman
            wrote on 4 Oct 2019, 15:16 last edited by
            #5

            how do I know the right version? You mean I must download and install Win32 OpenSSL on my windows like any other program, I used the 5.3 version because I tried 5.13 and failed so I try to use the exactly same version that was used in https://wiki.qt.io/Building_a_static_Qt_for_Windows_using_MinGW
            and also I have some other questions before static compile again, it´s a time comsumming process .
            First, to delete the previous static build should I just simply delete the static folder, no other step needs to be done.
            Second, I need to use sql in the future should I leave the script as it is,
            I used a library named QtXlsx how to add it to the static compilation.
            Again excuse for my ignarance, and thanks for the quick reply.

            M 1 Reply Last reply 4 Oct 2019, 17:51
            0
            • P pjorgegerman
              4 Oct 2019, 15:16

              how do I know the right version? You mean I must download and install Win32 OpenSSL on my windows like any other program, I used the 5.3 version because I tried 5.13 and failed so I try to use the exactly same version that was used in https://wiki.qt.io/Building_a_static_Qt_for_Windows_using_MinGW
              and also I have some other questions before static compile again, it´s a time comsumming process .
              First, to delete the previous static build should I just simply delete the static folder, no other step needs to be done.
              Second, I need to use sql in the future should I leave the script as it is,
              I used a library named QtXlsx how to add it to the static compilation.
              Again excuse for my ignarance, and thanks for the quick reply.

              M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 4 Oct 2019, 17:51 last edited by
              #6

              @pjorgegerman
              Hi
              https://doc.qt.io/archives/qt-5.5/build-sources.html#openssl-v1later
              "From Qt version 5.2 onwards, the officially supported version for OpenSSL is 1.0.0 or later. Versions >= 0.9.7 and < 1.0.0 might work, but are not guaranteed to."

              So OpenSSL v1.0.2L should work.
              If you have issues with compiling it, search the forum.
              other have done it before.
              https://forum.qt.io/topic/94328/qt-static-with-openssl-issue

              Yes building a static version takes lots of effort. Depending on your SQL needs later, it
              might also be a small fight if its not SQLLite you want to use.

              Its best to start clean over every time as keeping old build artifacts, more often cause issues
              than speed up the process.

              This one QtXlsx ?
              https://github.com/dbzhang800/QtXlsxWriter
              If yes, then i would go with option 2
              Usage(2): Use source code directly
              and compiled it into the app to avoid having to build the module as static.

              1 Reply Last reply
              0

              1/6

              4 Oct 2019, 13:50

              • Login

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