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. Linking against Openssl 1.1.2-dev Libs
QtWS25 Last Chance

Linking against Openssl 1.1.2-dev Libs

Scheduled Pinned Locked Moved Solved General and Desktop
openssllibrabrieslinkinglibrary
13 Posts 3 Posters 3.7k 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.
  • C Christian Ehrlicher
    2 Dec 2018, 17:56

    @Opa114 said in Linking against Openssl 1.1.2-dev Libs:

    -llibssl.dll

    Afaik you can't link directly against a dll but need an import lib. There must be a 'libssl.a' somehwere around which you have to link to with '-lssl'. The same goes for libcrypto.dll

    O Offline
    O Offline
    Opa114
    wrote on 2 Dec 2018, 18:01 last edited by
    #3

    @Christian-Ehrlicher
    sorry my mistake - i copied some old stuff. i removed the *.dll ending.
    Inside the folder: L$$PWD/../openssl/openssl/ there is a licrypto.a and libcrypto.dll.a, same for the ssl lib.

    1 Reply Last reply
    0
    • C Christian Ehrlicher
      2 Dec 2018, 17:56

      @Opa114 said in Linking against Openssl 1.1.2-dev Libs:

      -llibssl.dll

      Afaik you can't link directly against a dll but need an import lib. There must be a 'libssl.a' somehwere around which you have to link to with '-lssl'. The same goes for libcrypto.dll

      A Offline
      A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on 2 Dec 2018, 18:02 last edited by aha_1980 12 Feb 2018, 18:03
      #4

      Hi @Opa114,

      Just to add to @Christian-Ehrlicher,

      There must be a 'libssl.a' somehwere around

      Or, depending on compiler, its named libssl.lib.

      So the linker call should look like this:
      win32: LIBS += -L$$PWD/../openssl/openssl/ -lcrypto -lssl

      Also, make sure OpenSSL was build with the same compiler you are using for your Qt project.

      Regards

      Qt has to stay free or it will die.

      O 1 Reply Last reply 2 Dec 2018, 18:11
      0
      • A aha_1980
        2 Dec 2018, 18:02

        Hi @Opa114,

        Just to add to @Christian-Ehrlicher,

        There must be a 'libssl.a' somehwere around

        Or, depending on compiler, its named libssl.lib.

        So the linker call should look like this:
        win32: LIBS += -L$$PWD/../openssl/openssl/ -lcrypto -lssl

        Also, make sure OpenSSL was build with the same compiler you are using for your Qt project.

        Regards

        O Offline
        O Offline
        Opa114
        wrote on 2 Dec 2018, 18:11 last edited by
        #5

        @aha_1980 said in Linking against Openssl 1.1.2-dev Libs:

        Hi @Opa114,

        Just to add to @Christian-Ehrlicher,

        There must be a 'libssl.a' somehwere around

        Or, depending on compiler, its named libssl.lib.

        So the linker call should look like this:
        win32: LIBS += -L$$PWD/../openssl/openssl/ -lcrypto -lssl

        Also, make sure OpenSSL was build with the same compiler you are using for your Qt project.

        Regards

        when i try it with -lcrypto and -lssl then i got this error:

        skipping incompatible C:\Users\Matth\Desktop\openssl\openssl/libcrypto.a when searching for -lcrypto
        skipping incompatible C:\Users\Matth\Desktop\openssl\openssl/libcrypto.dll.a when searching for -lcrypto
        cannot find -lcrypto
        

        same for the ssl library.

        A 1 Reply Last reply 2 Dec 2018, 18:14
        0
        • O Opa114
          2 Dec 2018, 18:11

          @aha_1980 said in Linking against Openssl 1.1.2-dev Libs:

          Hi @Opa114,

          Just to add to @Christian-Ehrlicher,

          There must be a 'libssl.a' somehwere around

          Or, depending on compiler, its named libssl.lib.

          So the linker call should look like this:
          win32: LIBS += -L$$PWD/../openssl/openssl/ -lcrypto -lssl

          Also, make sure OpenSSL was build with the same compiler you are using for your Qt project.

          Regards

          when i try it with -lcrypto and -lssl then i got this error:

          skipping incompatible C:\Users\Matth\Desktop\openssl\openssl/libcrypto.a when searching for -lcrypto
          skipping incompatible C:\Users\Matth\Desktop\openssl\openssl/libcrypto.dll.a when searching for -lcrypto
          cannot find -lcrypto
          

          same for the ssl library.

          A Offline
          A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on 2 Dec 2018, 18:14 last edited by
          #6

          @Opa114 said in Linking against Openssl 1.1.2-dev Libs:

          skipping incompatible

          That is already a hint :)

          Again:

          • which compiler is used for OpenSSL and for your project?
          • are both 32bit resp. 64bit?

          Regards

          Qt has to stay free or it will die.

          O 1 Reply Last reply 2 Dec 2018, 18:21
          2
          • A aha_1980
            2 Dec 2018, 18:14

            @Opa114 said in Linking against Openssl 1.1.2-dev Libs:

            skipping incompatible

            That is already a hint :)

            Again:

            • which compiler is used for OpenSSL and for your project?
            • are both 32bit resp. 64bit?

            Regards

            O Offline
            O Offline
            Opa114
            wrote on 2 Dec 2018, 18:21 last edited by
            #7

            @aha_1980
            For OpenSSL i used MinGW (this way and built it under Ubuntu: ./Configure mingw --cross-compile-prefix=i686-w64-mingw32- - prefix=/mnt/c/Users/Matth/Desktop/openssl/BUILD)

            And for my Project i used MinGW 64 (qmake: qmake.exe test.pro -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug" and Make: mingw32-make.exe -j4 in C:\Users\Matth\Desktop\build-test-Desktop_Qt_5_12_0_MinGW_64_bit-Debug)

            But both should be 32bit builds i think.

            A 1 Reply Last reply 2 Dec 2018, 18:26
            0
            • O Opa114
              2 Dec 2018, 18:21

              @aha_1980
              For OpenSSL i used MinGW (this way and built it under Ubuntu: ./Configure mingw --cross-compile-prefix=i686-w64-mingw32- - prefix=/mnt/c/Users/Matth/Desktop/openssl/BUILD)

              And for my Project i used MinGW 64 (qmake: qmake.exe test.pro -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug" and Make: mingw32-make.exe -j4 in C:\Users\Matth\Desktop\build-test-Desktop_Qt_5_12_0_MinGW_64_bit-Debug)

              But both should be 32bit builds i think.

              A Offline
              A Offline
              aha_1980
              Lifetime Qt Champion
              wrote on 2 Dec 2018, 18:26 last edited by aha_1980 12 Feb 2018, 18:39
              #8

              @Opa114 said in Linking against Openssl 1.1.2-dev Libs:

              i686-w64-mingw32

              Are you sure this means 32 bit?

              Edit: at least MinGW 64 is not 32bit ;)

              Edit2: can you build OpenSSL on Windows with the MinGW64 compiler? Should avoid all possible incompatibilities :)

              Qt has to stay free or it will die.

              O 1 Reply Last reply 2 Dec 2018, 19:05
              0
              • A aha_1980
                2 Dec 2018, 18:26

                @Opa114 said in Linking against Openssl 1.1.2-dev Libs:

                i686-w64-mingw32

                Are you sure this means 32 bit?

                Edit: at least MinGW 64 is not 32bit ;)

                Edit2: can you build OpenSSL on Windows with the MinGW64 compiler? Should avoid all possible incompatibilities :)

                O Offline
                O Offline
                Opa114
                wrote on 2 Dec 2018, 19:05 last edited by
                #9

                @aha_1980 said in Linking against Openssl 1.1.2-dev Libs:

                Edit2: can you build OpenSSL on Windows with the MinGW64 compiler? Should avoid all possible incompatibilities :)

                i could try it

                O 1 Reply Last reply 2 Dec 2018, 20:21
                0
                • O Opa114
                  2 Dec 2018, 19:05

                  @aha_1980 said in Linking against Openssl 1.1.2-dev Libs:

                  Edit2: can you build OpenSSL on Windows with the MinGW64 compiler? Should avoid all possible incompatibilities :)

                  i could try it

                  O Offline
                  O Offline
                  Opa114
                  wrote on 2 Dec 2018, 20:21 last edited by
                  #10

                  @Opa114
                  instead of building openssl under windows i run it again under ubuntu and did a cross compile but now with minGW 64bit which creates a 64-bit dll. With these it works. but should a 64bit application able to use 32bit dlls? Or i am wrong?

                  A 1 Reply Last reply 2 Dec 2018, 20:25
                  0
                  • O Opa114
                    2 Dec 2018, 20:21

                    @Opa114
                    instead of building openssl under windows i run it again under ubuntu and did a cross compile but now with minGW 64bit which creates a 64-bit dll. With these it works. but should a 64bit application able to use 32bit dlls? Or i am wrong?

                    A Offline
                    A Offline
                    aha_1980
                    Lifetime Qt Champion
                    wrote on 2 Dec 2018, 20:25 last edited by
                    #11

                    @Opa114 said in Linking against Openssl 1.1.2-dev Libs:

                    But should a 64bit application able to use 32bit dlls? Or i am wrong?

                    Sorry, but yes you are. You cannot mix these.

                    Regards

                    Qt has to stay free or it will die.

                    O 1 Reply Last reply 3 Dec 2018, 09:18
                    3
                    • A aha_1980
                      2 Dec 2018, 20:25

                      @Opa114 said in Linking against Openssl 1.1.2-dev Libs:

                      But should a 64bit application able to use 32bit dlls? Or i am wrong?

                      Sorry, but yes you are. You cannot mix these.

                      Regards

                      O Offline
                      O Offline
                      Opa114
                      wrote on 3 Dec 2018, 09:18 last edited by
                      #12

                      @aha_1980 said in Linking against Openssl 1.1.2-dev Libs:

                      @Opa114 said in Linking against Openssl 1.1.2-dev Libs:

                      But should a 64bit application able to use 32bit dlls? Or i am wrong?

                      Sorry, but yes you are. You cannot mix these.

                      Regards

                      okay thanks for clarification. So it was my mistake because i thought i can mix it. I know the other way would not work.

                      A 1 Reply Last reply 3 Dec 2018, 09:19
                      1
                      • O Opa114
                        3 Dec 2018, 09:18

                        @aha_1980 said in Linking against Openssl 1.1.2-dev Libs:

                        @Opa114 said in Linking against Openssl 1.1.2-dev Libs:

                        But should a 64bit application able to use 32bit dlls? Or i am wrong?

                        Sorry, but yes you are. You cannot mix these.

                        Regards

                        okay thanks for clarification. So it was my mistake because i thought i can mix it. I know the other way would not work.

                        A Offline
                        A Offline
                        aha_1980
                        Lifetime Qt Champion
                        wrote on 3 Dec 2018, 09:19 last edited by
                        #13

                        @Opa114 Thanks for the feedback. So please mark this topic as SOLVED now.

                        Qt has to stay free or it will die.

                        1 Reply Last reply
                        0

                        12/13

                        3 Dec 2018, 09:18

                        • Login

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