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. Building Qt5 with OpenSSL support using VS 2015
Forum Updated to NodeBB v4.3 + New Features

Building Qt5 with OpenSSL support using VS 2015

Scheduled Pinned Locked Moved Unsolved General and Desktop
23 Posts 6 Posters 7.9k 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.
  • C Online
    C Online
    Christian Ehrlicher
    Lifetime Qt Champion
    wrote on 30 Jan 2019, 06:53 last edited by
    #13

    Are you building for 64 or 32 bit target architecture?
    And since you've a commercial license you could ask the Qt Company for help.

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

    T 1 Reply Last reply 30 Jan 2019, 07:35
    1
    • C Christian Ehrlicher
      30 Jan 2019, 06:53

      Are you building for 64 or 32 bit target architecture?
      And since you've a commercial license you could ask the Qt Company for help.

      T Offline
      T Offline
      Taytoo
      wrote on 30 Jan 2019, 07:35 last edited by
      #14

      @Christian-Ehrlicher said in Building Qt5 with OpenSSL support using VS 2015:

      Are you building for 64 or 32 bit target architecture?
      And since you've a commercial license you could ask the Qt Company for help.

      32-bit.

      I'm currently evaluating QT for our commercial software, thought the setup would be straightforward but keep running into one issue after another, so treating it as learning process - still frustrating though.

      1 Reply Last reply
      0
      • C Online
        C Online
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on 30 Jan 2019, 08:20 last edited by
        #15

        Can you show us the link line of Qt5Network.lib? Must be directly above the linker errors.

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

        1 Reply Last reply
        0
        • T Offline
          T Offline
          Taytoo
          wrote on 30 Jan 2019, 08:32 last edited by
          #16

          Finally, got it working! Re-set everything again, unzipped fresh sources etc and used this configure...

          configure -commercial -static -debug-and-release -prefix C:\Qt\Static\5.12.0 -platform win32-msvc2017 -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -sql-odbc -sql-sqlite -make libs -nomake tools -nomake examples -nomake tests -openssl-linked OPENSSL_LIBS="-llibssl -llibcrypto" -I c:\openssl\build32\include -L c:\openssl\build32\lib
          

          not sure if moving openssl-linked ahead made any difference, but I'll just save these settings and stick with them.

          Now, how do I update my Visual studio project to link QT statically?

          T 1 Reply Last reply 30 Jan 2019, 10:00
          0
          • T Taytoo
            30 Jan 2019, 08:32

            Finally, got it working! Re-set everything again, unzipped fresh sources etc and used this configure...

            configure -commercial -static -debug-and-release -prefix C:\Qt\Static\5.12.0 -platform win32-msvc2017 -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -sql-odbc -sql-sqlite -make libs -nomake tools -nomake examples -nomake tests -openssl-linked OPENSSL_LIBS="-llibssl -llibcrypto" -I c:\openssl\build32\include -L c:\openssl\build32\lib
            

            not sure if moving openssl-linked ahead made any difference, but I'll just save these settings and stick with them.

            Now, how do I update my Visual studio project to link QT statically?

            T Offline
            T Offline
            Taytoo
            wrote on 30 Jan 2019, 10:00 last edited by
            #17

            Still working on the static environment setup, getting whole bunch of unresolved external errors. The build config is Win32, which is inline with static qt win32 build. also double checked and QT libs are added as Additional libraries in project settings.

            In the image below, first two errors are related to an internal lib. The remaining errors are all unresolved externals. I did go through an interesting checklist here (https://heejune.me/2015/12/03/resolving-the-lnk2019-error-while-link-qt-app/) and don't see anything that applies to my config.
            0_1548842162714_unresolved.JPG

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 30 Jan 2019, 22:02 last edited by
              #18

              Hi,

              Might be a silly question but why are you using the VS2017 mkspec for VS2015 ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              T 1 Reply Last reply 31 Jan 2019, 02:37
              0
              • S SGaist
                30 Jan 2019, 22:02

                Hi,

                Might be a silly question but why are you using the VS2017 mkspec for VS2015 ?

                T Offline
                T Offline
                Taytoo
                wrote on 31 Jan 2019, 02:37 last edited by
                #19

                @SGaist I moved to VS17 because I was getting corecrt errors while building QT.

                Two unresolved errors were solved by adding ws2_32.lib. Also, went into Qt Project Settings - Qt Modules and checked a whole bunch of modules. Now I'm getting only one linker error. Maybe its related to the two E2512 errors?

                0_1548902195774_unresolved2.JPG

                1 Reply Last reply
                0
                • T Offline
                  T Offline
                  Taytoo
                  wrote on 31 Jan 2019, 10:54 last edited by
                  #20

                  I've managed to fix the preprocessor error but still not able to figure out linker error. Weird thing is that I've tried compiling my app by linking dynamically with QT (default config) and even that is giving out the same error, so its probably not something specific to static linking with QT.

                  Last time my project was compiling successfully in VS2015 against qt dlls. Uninstalled VS2015, installed VS2017 and now seeing this linker error. Any tips?

                  1 Reply Last reply
                  0
                  • T Offline
                    T Offline
                    Taytoo
                    wrote on 31 Jan 2019, 21:43 last edited by
                    #21

                    Fixed my compilation issue and also Found a Bug in Qt.

                    Repro: In Visual Studio. Go to Qt VS Tools -> Qt Project Settings -> Qt Modules (Tab) and make changes. This will add

                    \
                    $(INHERIT)\
                    

                    into the project's Linker -> Additional Dependencies. Removing the slashes solved the problem. No wonder I couldn't figure out what the object file was when I was getting ".obj" error during compilation.

                    1 Reply Last reply
                    0
                    • T Offline
                      T Offline
                      Taytoo
                      wrote on 1 Feb 2019, 02:39 last edited by
                      #22
                              cd examples\ && ( if not exist Makefile C:\Qt\Static\qt-everywhere-src-5.12.0\qtbase\bin\qmake.exe -o Makefile C
                      :\Qt\Static\qt-everywhere-src-5.12.0\qtnetworkauth\examples\examples.pro ) && "C:\Program Files (x86)\Microsoft Visual S
                      tudio\2017\Professional\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\nmake.exe" -f Makefile distclean
                      ASSERT: "fileName.isEmpty() || isAbsolutePath(fileName)" in file C:\Qt\Static\qt-everywhere-src-5.12.0\qtbase\qmake\libr
                      ary\ioutils.cpp, line 53
                      NMAKE : fatal error U1077: 'cd' : return code '0x40000015'
                      Stop.
                      NMAKE : fatal error U1077: 'cd' : return code '0x2'
                      Stop.
                      

                      When I run nmake distclean in sources folder, its keeps running for a while and eventually ends with this error. I built Qt with "nomake examples" flag, is that the reason? Do I need to unzip fresh sources again or can I just ignore this and continue by calling configure and jom?

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on 8 Feb 2019, 20:24 last edited by
                        #23

                        No, examples are just normal projects. You can open them in Qt Creator and build them from there.

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        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