CentOS上编译myget时报SSL错误的解决办法

在CentOS上编译myget时遇到SSL相关错误,表现为链接阶段出现undefined reference。通过在g++编译命令后添加`-lssl`解决了问题。
摘要由CSDN通过智能技术生成

      今天在centos上编译myget,报下面的错误:

make  all-recursive
make[1]: Entering directory `/root/soft/myget-0.1.2'
Making all in src
make[2]: Entering directory `/root/soft/myget-0.1.2/src'
g++  -D_FILE_OFFSET_BITS=64   -o mytget  debug.o advio.o tcp.o url.o utils.o block.o header.o plugin.o proxy.o task.o http.o httpplugin.o ftp.o ftpparser.o ftpplugin.o downloader.o myget.o mytget.o progressbar.o  -lpthread
advio.o: In function `IOStream::write(char*, int, long)':
advio.cpp:(.text+0x709): undefined reference to `SSL_write'
advio.o: In function `IOStream::read(char*, int, long)':
advio.cpp:(.text+0x951): undefined reference to `SSL_read'
advio.cpp:(.text+0x983): undefined reference to `SSL_get_error'
advio.o: In function `IOStream::ssl_connect()':
advio.cpp:(.text+0xc8e): undefined reference to `SSL_connect'
advio.cpp:(.text+0xcb1): undefined reference to `SSL_get_error'
advio.o: In function `IOStream::set_fd(int)':
advio.cpp:(.text+0xd22): undefined reference to `SSL_set_fd'
advio.cpp:(.text+0xd30): undefined reference to `SSL_connect'
advio.cpp:(.text+0xd53): undefined reference to `SSL_get_error'
advio.o: In function `IOStream::set_use_ssl(bool)':
advio.cpp:(.text+0xdfb): undefined reference to `SSL_CTX_free'
advio.cpp:(.text+0xe00): undefined reference to `SSLv23_client_method'
advio.cpp:(.text+0xe08): undefined reference to `SSL_CTX_new'
advio.cpp:(.text+0xe1e): undefined reference to `SSL_new'
advio.cpp:(.text+0xe3d): undefined reference to `SSL_set_fd'
advio.cpp:(.text+0xe54): undefined reference to `SSL_shutdown'
advio.cpp:(.text+0xe84): undefined reference to `SSL_CTX_free'
advio.o: In function `IOStream::~IOStream()':
advio.cpp:(.text+0xea5): undefined reference to `SSL_shutdown'
advio.cpp:(.text+0xecb): undefined reference to `SSL_CTX_free'
advio.o: In function `IOStream::~IOStream()':
advio.cpp:(.text+0xef9): undefined reference to `SSL_shutdown'
advio.cpp:(.text+0xf1f): undefined reference to `SSL_CTX_free'
mytget.o: In function `main':
mytget.cpp:(.text+0x2db): undefined reference to `SSL_load_error_strings'
mytget.cpp:(.text+0x2e0): undefined reference to `SSL_library_init'
collect2: ld returned 1 exit status
make[2]: *** [mytget] Error 1
make[2]: Leaving directory `/root/soft/myget-0.1.2/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/soft/myget-0.1.2'
make: *** [all] Error 2

    然后我直接复制里面的g++编译语句,后面加上-lssl, 问题解决。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值