Libcurl使用OpenSSL编译出现undefined reference to `COMP_CTX_free'错误备忘
来源:互联网 发布:阿里云个人邮箱登录 编辑:程序博客网 时间:2024/06/05 19:24
2014-04-22 wcdj
在上篇文章中《Libcurl库支持SSL协议的编译方法》完成了对Libcurl库(支持SSL/TSL)的编译。然后用此库在编译demo时发现了如下编译错误:
$make -f demo_makefile g++ -o http_demo http_demo.o -L../../lib/ -L../../dep/curl-7.34.0/lib -L../../dep/openssl-1.0.1g/lib -lhttp -lcurl -lcrypto -lssl -lrt -lz -ldl../../dep/openssl-1.0.1g/lib/libssl.a(s3_clnt.o): In function `ssl3_check_cert_and_algorithm':s3_clnt.c:(.text+0x313): undefined reference to `X509_certificate_type'../../dep/openssl-1.0.1g/lib/libssl.a(s3_enc.o): In function `ssl3_change_cipher_state':s3_enc.c:(.text+0xc30): undefined reference to `COMP_CTX_free's3_enc.c:(.text+0xc4d): undefined reference to `COMP_CTX_new's3_enc.c:(.text+0xced): undefined reference to `COMP_CTX_free's3_enc.c:(.text+0xd06): undefined reference to `COMP_CTX_new'
网上这篇文章给出了解决方法,但是并没有给出原因,其实就是库的依赖问题(ssl依赖crypt的方法),仔细看OpenSSL的配置文件已经给出了正确的使用的方法。
I have solved the problem. The solution is simple, for some reason, when linking the library, -lssl must be in front of -lcrypto. This does not happen with the libraries provided by Ubuntu. I wonder why.... If anyone can shed some light on this, I would greatly appreciate it. But anyway, I solved the main issue. Hope this helps others like me.
Demo和Makefile可以参考GitHub上的代码。
https://github.com/gerryyang/wcdj/tree/master/src/demo/http
0 0
- Libcurl使用OpenSSL编译出现undefined reference to `COMP_CTX_free'错误备忘
- NDK编译出现undefined reference to错误
- 编译tslib1.4出现错误undefined reference to rpl_malloc错误
- TORNADO下编译出现undefined reference to `itoa'错误
- 编译出现这种错误 undefined reference to '__gxx_personality_v0'
- 交叉编译中出现的 'Undefined reference to __aeabi_read_tp' 错误
- 编译什么时候出现Undefined reference to 的错误
- linux编译出现undefined reference to `pow‘的错误
- 编译WU FTPD出现"undefined reference to crypt"错误解决方法
- 编译3.10内核 出现错误 “undefined reference to...." 解决方法
- 编译node-v4.2.1,出现错误:undefined reference to getpwuid_r
- gcc 编译出现undefined reference to‘pthread_create’的错误
- linux编译出现undefined reference to symbol 'pthread_create错误解决方案
- QT编译出现错误 “undefined reference to ‘vtable for xxx’”
- NDK编译出现 error: undefined reference to 错误
- cocos2d-x 使用ndk编译 x86 出现 in function Curl_resolv_timeout: undefined reference to 'sigsetjmp' 错误
- 使用g++编译C/C++程序,链接时出现undefined reference to错误
- 使用NDK编译的时候出现 undefined reference to
- bop_2014_round_2b
- 函数热身 练习一
- POJ 2208 Pyramids&&HDU 1411 校庆神秘建筑(欧拉四面体公式)
- C++ Set 容器
- Linux中inode的理解
- Libcurl使用OpenSSL编译出现undefined reference to `COMP_CTX_free'错误备忘
- 在asp.net中使用excel模板
- 二叉树的遍历
- 为什么调用 FragmentPagerAdapter.notifyDataSetChanged() 并不能更新其 Fragment?
- 数据结构 - 表插入排序 详解 及 代码(C++)
- 一个小问题。
- jquery的ajax请求与springMVC交互
- 什么是反向代理?
- 使用js判断是手机访问还是电脑访问