载入OpenSSL的动态库——学会使用tryToLoadOpenSslWin32Library和QPair
- 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
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.html
- http://sophie.zarb.org/distrib/Fedora/18/i386/by-pkgid/75c6e42b0cde6481d0fb179df846c7c1/files/8
- http://blog.debao.me/2013/12/openssl-and-qt/
载入OpenSSL的动态库——学会使用tryToLoadOpenSslWin32Library和QPair的更多相关文章
- openssl链接动态库的方法
错误:AES_set_decrypt_key 一. 编译时: 1. 不要在windows与linux共享区编译2. ./config no-asm -fPIC3. make 二. cp: cannot ...
- 修改OpenSSL默认编译出的动态库文件名称
在 Windows 平台上调用动态链接库 dll 文件时,有两种方式:a) 隐式的加载时链接:使用 *.lib (导入库)文件,在 IDE 的链接器相关设置中加入导入库 lib 文件的名称,或在程序中 ...
- linux动态库的种种要点
linux下使用动态库,基本用起来还是非常easy.但假设我们的程序中大量使用动态库来实现各种框架/插件,那么就会遇到一些坑,掌握这些坑才有利于程序更稳健地执行. 本篇先谈谈动态库符号方面的问题. 測 ...
- C++静态库和动态库
静态库与动态库 首先简单介绍一下gcc 指令 ubuntu 下安装gcc g++ 方法 sudo apt install gcc g++ gcc 的简单使用 建立hello.c 源文件 gcc hel ...
- vs2008编译openssl,静态库/动态库,批处理
::前期准备准备工作::1,下载安装好ActivePerl,::2,下载Openssl源码::3,本机有安装vc::4,此例在vs2008(vc9),openssl-1.0.2o下完成 echo of ...
- openssl动态库编译
通常Linux系统自带OpenSSL,但是其so文件由于没有debug信息,因此无法跟踪内部函数,对于学习 不太方便,需要通过源码重新安装. 我的Linux系统是CentOS7,自带的 ...
- C++ 系列:静态库与动态库
转载自http://www.cnblogs.com/skynet/p/3372855.html 这次分享的宗旨是——让大家学会创建与使用静态库.动态库,知道静态库与动态库的区别,知道使用的时候如何选择 ...
- C++静态库与动态库
C++静态库与动态库 这次分享的宗旨是--让大家学会创建与使用静态库.动态库,知道静态库与动态库的区别,知道使用的时候如何选择.这里不深入介绍静态库.动态库的底层格式,内存布局等,有兴趣的同学,推荐一 ...
- Linux系统中“动态库”和“静态库”那点事儿 /etc/ld.so.conf 动态库的后缀为*.so 静态库的后缀为 libxxx.a ldconfig 目录名
Linux系统中“动态库”和“静态库”那点事儿 /etc/ld.so.conf 动态库的后缀为*.so 静态库的后缀为 libxxx.a ldconfig 目录名 转载自:http://b ...
随机推荐
- Log4net 可直接使用的配置
config配置 <xml version="1.0"> <configuration> <configSections> <!--配置一 ...
- C# dynamic类型
dynamic类型是C#4.0中引入的新类型,它允许其操作掠过编译器类型检查,而在运行时处理.dynami类型在绝大多数情况下和object类型相似,不同之处在于编译器对于包含了dynamic的表达式 ...
- c++ ifstream ofstream 文件流
#include <fstream>ofstream //文件写操作 内存写入存储设备 ifstream //文件读操作,存储设备读区到内存中fstream //读写操作,对打开的文件可进 ...
- 2.9 Model Selection and the Bias–Variance Tradeoff
结论 模型复杂度↑Bias↓Variance↓ 例子 $y_i=f(x_i)+\epsilon_i,E(\epsilon_i)=0,Var(\epsilon_i)=\sigma^2$ 使用knn做预测 ...
- 更新ORACLE数据时遇到锁死情况的处理
我们在操作数据库的 时候,有时候会由于操作不当引起数据库表被锁定,这么我们经常不知所措,不知怎么给这些表解锁,在pl/sql Developer工具的的菜单“tools”里面的“sessions”可以 ...
- Impala 3、Impala、Hbase整合
Impala可以通过Hive外部表方式和HBase进行整合,步骤如下: • 步骤1:创建hbase 表,向表中添加数据 create 'test_info', 'info' put 'test_inf ...
- 表格td标签在不添加多余标签的情况下实现文本内容单行显示,多余部分省略号表示的方法
#table { table-layout: fixed; } .content { white-space: nowrap; text-overflow: ellipsis; -o-text-ove ...
- IOS ViewController 生命周期
加载过程 第一步 -(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 第二步 -(void) ...
- ubuntu 14.04 chromium 设备adobe flash player(亲测可行)
首先,根据浏览器提示下载Adobe Flash Player 插入 install_flash_player_11_linux.x86_64.tar.gz;然后使用sudo tar -xzvf ins ...
- crm使用soap更改下拉框的文本值
//C#代码 //UpdateStateValueRequest updateStateValue = new UpdateStateValueRequest //{ // AttributeL ...