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
Forum Updated to NodeBB v4.3 + New Features

Linking against Openssl 1.1.2-dev Libs

Scheduled Pinned Locked Moved Solved General and Desktop
openssllibrabrieslinkinglibrary
13 Posts 3 Posters 3.9k 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.
  • Christian EhrlicherC Offline
    Christian EhrlicherC Offline
    Christian Ehrlicher
    Lifetime Qt Champion
    wrote on last edited by
    #2

    @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

    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
    Visit the Qt Academy at https://academy.qt.io/catalog

    O aha_1980A 2 Replies Last reply
    2
    • Christian EhrlicherC Christian Ehrlicher

      @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 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
      • Christian EhrlicherC Christian Ehrlicher

        @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

        aha_1980A Offline
        aha_1980A Offline
        aha_1980
        Lifetime Qt Champion
        wrote on last edited by aha_1980
        #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
        0
        • aha_1980A aha_1980

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

          aha_1980A 1 Reply Last reply
          0
          • O Opa114

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

            aha_1980A Offline
            aha_1980A Offline
            aha_1980
            Lifetime Qt Champion
            wrote on 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
            • aha_1980A aha_1980

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

              aha_1980A 1 Reply Last reply
              0
              • O Opa114

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

                aha_1980A Offline
                aha_1980A Offline
                aha_1980
                Lifetime Qt Champion
                wrote on last edited by aha_1980
                #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
                0
                • aha_1980A aha_1980

                  @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 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
                  0
                  • O Opa114

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

                    aha_1980A 1 Reply Last reply
                    0
                    • O Opa114

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

                      aha_1980A Offline
                      aha_1980A Offline
                      aha_1980
                      Lifetime Qt Champion
                      wrote on 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
                      • aha_1980A aha_1980

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

                        aha_1980A 1 Reply Last reply
                        1
                        • O Opa114

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

                          aha_1980A Offline
                          aha_1980A Offline
                          aha_1980
                          Lifetime Qt Champion
                          wrote on 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

                          • Login

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