• 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的更多相关文章

  1. openssl链接动态库的方法

    错误:AES_set_decrypt_key 一. 编译时: 1. 不要在windows与linux共享区编译2. ./config no-asm -fPIC3. make 二. cp: cannot ...

  2. 修改OpenSSL默认编译出的动态库文件名称

    在 Windows 平台上调用动态链接库 dll 文件时,有两种方式:a) 隐式的加载时链接:使用 *.lib (导入库)文件,在 IDE 的链接器相关设置中加入导入库 lib 文件的名称,或在程序中 ...

  3. linux动态库的种种要点

    linux下使用动态库,基本用起来还是非常easy.但假设我们的程序中大量使用动态库来实现各种框架/插件,那么就会遇到一些坑,掌握这些坑才有利于程序更稳健地执行. 本篇先谈谈动态库符号方面的问题. 測 ...

  4. C++静态库和动态库

    静态库与动态库 首先简单介绍一下gcc 指令 ubuntu 下安装gcc g++ 方法 sudo apt install gcc g++ gcc 的简单使用 建立hello.c 源文件 gcc hel ...

  5. vs2008编译openssl,静态库/动态库,批处理

    ::前期准备准备工作::1,下载安装好ActivePerl,::2,下载Openssl源码::3,本机有安装vc::4,此例在vs2008(vc9),openssl-1.0.2o下完成 echo of ...

  6. openssl动态库编译

    通常Linux系统自带OpenSSL,但是其so文件由于没有debug信息,因此无法跟踪内部函数,对于学习 不太方便,需要通过源码重新安装.         我的Linux系统是CentOS7,自带的 ...

  7. C++ 系列:静态库与动态库

    转载自http://www.cnblogs.com/skynet/p/3372855.html 这次分享的宗旨是——让大家学会创建与使用静态库.动态库,知道静态库与动态库的区别,知道使用的时候如何选择 ...

  8. C++静态库与动态库

    C++静态库与动态库 这次分享的宗旨是--让大家学会创建与使用静态库.动态库,知道静态库与动态库的区别,知道使用的时候如何选择.这里不深入介绍静态库.动态库的底层格式,内存布局等,有兴趣的同学,推荐一 ...

  9. Linux系统中“动态库”和“静态库”那点事儿 /etc/ld.so.conf 动态库的后缀为*.so 静态库的后缀为 libxxx.a ldconfig 目录名

    Linux系统中“动态库”和“静态库”那点事儿 /etc/ld.so.conf  动态库的后缀为*.so  静态库的后缀为 libxxx.a   ldconfig   目录名 转载自:http://b ...

随机推荐

  1. Struts2+JQuery+JSON实现异步交互

    1.环境 jquery:jquery-1.9.0.min.js struts2:基本包就不说了,就说说应用json的包,主要有struts2-json-plugin-2.3.8.jar json:js ...

  2. 通过Alexa API获取Alexa排名

    我们通会用Alexa的网站(或其它站长工具网站)来栓查我们的网​站流量排名,这样就必须去那些网站.实际上,可以通过Alexa XML API 获取网站的Alexa相关的数据(XML格式的),再使用XM ...

  3. KL25用SPI操作nor flash

    KL25的SPI连接一个nor flash.该flash型号为FM25F04,支持SPI的模式0和模式3,要求高位先发送,在上升沿采集数据. 通常,SPI有4种模式,取决于CPOL与CPHA如何配置. ...

  4. asm.uew

    /L16"ASM" Nocase Line Comment = ; File Extensions = ASM INC DEF /Colors = ,,,,, /Colors Ba ...

  5. SQL Server 视图

    视图实际上就是一个存储查询,重点是是可以混合和匹配来自基本表(或者其他视图)的数据,从而创建在很多方面像另一个基表那样起作用的对象.可以创建一个简单的查询,仅仅从一个表中选择几列,而忽略其他列:或者也 ...

  6. 深入浅出Node.js (2) - 模块机制

    2.1 CommonJS规范 2.1.1 CommonJS的出发点 2.1.2 CommonJS的模块规范 2.2 Node的模块实现 2.2.1 优先从缓存加载 2.2.2 路径分析和文件定位 2. ...

  7. C语言的本质(37)——makefile之隐含规则和模式规则

    Makefile有很多灵活的写法,可以写得更简洁,同时减少出错的可能.本节我们来看看这样一个例子还有哪些改进的余地. 一个目标依赖的所有条件不一定非得写在一条规则中,也可以拆开写,例如: main.o ...

  8. IOS添加多个按钮在导航栏

    UIView *customView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 75.0f, 30.0f)]; UIButton * ...

  9. vue+webpack项目实战

    概述 -- 项目中会用到的插件 vue-router vue-resource 打包工具 webpack 依赖环境 node.js start 安装vue开发的模板 # 全局安装 vue-cli $ ...

  10. linux配置yum源

    yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器.基於RPM包管理,能够从指定的服务器自动下载RP ...