关于在qt应用程序中编译openssl [英] about compiling openssl inside qt application
问题描述
我有带有MSVC的Qt 4.8.4(默认安装). 在我的应用程序中,我使用ssl连接到服务器. QtNetworkd4.dll需要运行时libeay32.dll和ssleay32.dll 如果我将这些库放在我的应用程序目录中,则一切正常.
I have Qt 4.8.4 (default installation) with MSVC. In my application I'm using ssl connection to the server. QtNetworkd4.dll requires runtime libeay32.dll and ssleay32.dll If I put these libs inside my app directory everything works fine.
我试图将openssl libs静态地编译到我的应用程序中,尽管编译可以进行,但是在启动期间,应用程序会抱怨未解析的符号,直到我将libeay32.dll和ssleay32.dll放到应用程序文件夹中为止.
I was trying to compile openssl libs statically into my application, although compilation goes fine, during startup application complains about unresolved symbols until I place libeay32.dll and ssleay32.dll into application folder.
所以问题是:是真的,将这些库编译到我的应用程序中是没有用的,因为QtNetwordkd4.dll不会在应用程序二进制文件中查找所需的功能/符号,而我应该使用内置的openssl编译整个Qt?像这样:
So question is: Is it true, that compiling these libs into my application is useless, because QtNetwordkd4.dll will not look for needed functions/symbols inside my application binary, and I should rather compile entire Qt with openssl built in? Like this:
configure -openssl -I C:\OpenSSL-Win32\include -L C:\OpenSSL-Win32\lib\VC\static
或者我想做的实际上是可行的,而我做错了什么,例如libeay32和ssleay32的版本错误等等?
Or what I'm trying to do is actually doable, and I've just done something wrong, like wrong version of libeay32 and ssleay32, etc. ?
出于两个原因,我正在尝试使用静态openssl进行编译
I'm trying to compile with static openssl for two reasons
- 我不必在我的应用程序目录中放置libeay32和ssleay32
- 恐怕在某些计算机上可能已经安装了不同版本的openssl,我的应用程序将与系统目录中的这些库进行交互.
推荐答案
尝试如下:
-openssl -openssl-linked -I C:\OpenSSL-Win32\include -L C:\OpenSSL-Win32\lib\VC\static OPENSSL_LIBS="-lUser32 -lAdvapi32 -lGdi32" OPENSSL_LIBS_DEBUG="-lssleay32MDd -llibeay32MDd" OPENSSL_LIBS_RELEASE="-lssleay32MD -llibeay32MD"
这篇关于关于在qt应用程序中编译openssl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!