Building Qt5 with OpenSSL support using VS 2015
-
@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.
-
Can you show us the link line of Qt5Network.lib? Must be directly above the linker errors.
-
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?
-
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.
-
Hi,
Might be a silly question but why are you using the VS2017 mkspec for VS2015 ?
-
@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?
-
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?
-
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.
-
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?
-
No, examples are just normal projects. You can open them in Qt Creator and build them from there.