c语言找不到静态库文件,[C语言] 解决引用openssl静态库libcrypto.a和libssl.a出现undefined reference to错误的问题...

在使用openssl进行http和https链接的C语言项目中遇到undefined reference错误,主要涉及pthread相关函数。解决方案是通过在链接命令中正确指定库路径和顺序:-L/usr/local/openssl/lib -lssl -lcrypto -ldl -lpthread。注意-lssl和-lcrypto应放在-ldl和-lpthread之前。
摘要由CSDN通过智能技术生成

最近在做使用openssl链接http和https的项目,编译时出现以下问题。

/usr/local/openssl/lib/libcrypto.a(async.o): In function `async_free_pool_internal':

async.c:(.text+0xe4): undefined reference to `pthread_setspecific'

async.c:(.text+0xf4): undefined reference to `pthread_getspecific'

async.c:(.text+0x104): undefined reference to `pthread_setspecific'

/usr/local/openssl/lib/libcrypto.a(async.o): In function `ASYNC_init_thread.part.1':

async.c:(.text+0x253): undefined reference to `pthread_setspecific'

/usr/local/openssl/lib/libcrypto.a(async.o): In function `async_start_func':

async.c:(.text+0x36f): undefined reference to `pthread_getspecific'

async.c:(.text+0x39e): undefined reference to `pthread_getspecific'

/usr/local/openssl/lib/libcrypto.a(async.o): In function `ASYNC_start_job&#

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值