载入OpenSSL的动态库——学会使用tryToLoadOpenSslWin32Library和QPair
2015-11-25 17:56
656 查看
Libraries name of openssl?
The "library" portion of OpenSSL consists of two libraries.
On posix system they are named:
libssl
libcrypto
while on Windows(32bit) they are named completely different:
libeay32
ssleay32
http://sophie.zarb.org/distrib/Fedora/18/i386/by-pkgid/75c6e42b0cde6481d0fb179df846c7c1/files/8 http://blog.debao.me/2013/12/openssl-and-qt/
The "library" portion of OpenSSL consists of two libraries.
On posix system they are named:
libssl
libcrypto
while on Windows(32bit) they are named completely different:
libeay32
ssleay32
qsslocket_openssl_symbols.cpp
static QPair<QSystemLibrary*, QSystemLibrary*> loadOpenSslWin32() { QPair<QSystemLibrary*,QSystemLibrary*> pair; pair.first = 0; pair.second = 0; // When OpenSSL is built using MSVC then the libraries are named 'ssleay32.dll' and 'libeay32'dll'. // When OpenSSL is built using GCC then different library names are used (depending on the OpenSSL version) // The oldest version of a GCC-based OpenSSL which can be detected by the code below is 0.9.8g (released in 2007) if (!tryToLoadOpenSslWin32Library(QLatin1String("ssleay32"), QLatin1String("libeay32"), pair)) { if (!tryToLoadOpenSslWin32Library(QLatin1String("libssl-10"), QLatin1String("libcrypto-10"), pair)) { if (!tryToLoadOpenSslWin32Library(QLatin1String("libssl-8"), QLatin1String("libcrypto-8"), pair)) { tryToLoadOpenSslWin32Library(QLatin1String("libssl-7"), QLatin1String("libcrypto-7"), pair); } } } return pair; }
ssl.pri
# Add optional SSL libs # Static linking of OpenSSL with msvc: # - Binaries http://slproweb.com/products/Win32OpenSSL.html # - also needs -lUser32 -lAdvapi32 -lGdi32 -lCrypt32 # - libs in <OPENSSL_DIR>\lib\VC\static # - configure: -openssl -openssl-linked -I <OPENSSL_DIR>\include -L <OPENSSL_DIR>\lib\VC\static OPENSSL_LIBS="-lUser32 -lAdvapi32 -lGdi32" OPENSSL_LIBS_DEBUG="-lssleay32MDd -llibeay32MDd" OPENSSL_LIBS_RELEASE="-lssleay32MD -llibeay32MD"
configure option
-no-openssl ........ Do not compile support for OpenSSL. + -openssl ........... Enable run-time OpenSSL support. -openssl-linked .... Enabled linked OpenSSL support.
Reference
http://www.ski-epic.com/2007_notes_on_openssl/index.htmlhttp://sophie.zarb.org/distrib/Fedora/18/i386/by-pkgid/75c6e42b0cde6481d0fb179df846c7c1/files/8 http://blog.debao.me/2013/12/openssl-and-qt/
相关文章推荐
- SharePoint 2013 Error - File names can't contain the following characters: & " ? < > # {} % ~ / \.
- Handler一定要在主线程实例化吗?new Handler()和new Handler(Looper.getMainLooper())的区别
- mybaits 多个参数传入用#{0,1,....}或者@Param注释
- 获取子进程终止状态:wait和waitpid
- ATL创建COM组件时找不到dllmain入口函数
- 深度分析WM_PAINT和WM_ERASEBKGND消息
- Lock&Condition实现线程同步通信
- codeforces-242A-Heads or Tails【暴力】
- ORA-01994: GRANT failed: password file missing or disabled
- 关于Installation error: INSTALL_FAILED_NO_MATCHING_ABIS的解决方法
- AIR 移动设备上的存储控制
- git中报unable to auto-detect email address 错误的解决拌办法
- 人脸检测“A Fast and Accurate Unconstrained Face Detector”
- 查找(一)史上最简单清晰的红黑树讲解 http://blog.csdn.net/yang_yulei/article/details/26066409
- paint和paintComponent方法的关系
- POJ1273 HDU1532 Drainage Ditches
- sizeof与offsetof有关的结构体详解 http://blog.csdn.net/callinglove/article/details/46534883
- 二叉树学习之二叉查找树 http://blog.csdn.net/callinglove/article/details/40707449
- Failed to configure driver: unknown error. Failed to open driver
- 线程之wait与sleep的区别