问题描述:

在更新cmake时,遇到如下问题

lib/libcmcurl.a(openssl.c.o): In function `sk_X509_EXTENSION_num':
openssl.c:(.text+0xdf): undefined reference to `OPENSSL_sk_num'
lib/libcmcurl.a(openssl.c.o): In function `sk_X509_EXTENSION_value':
openssl.c:(.text+0x101): undefined reference to `OPENSSL_sk_value'
lib/libcmcurl.a(openssl.c.o): In function `sk_X509_num':
openssl.c:(.text+0x11b): undefined reference to `OPENSSL_sk_num'
lib/libcmcurl.a(openssl.c.o): In function `sk_X509_value':
openssl.c:(.text+0x13d): undefined reference to `OPENSSL_sk_value'
lib/libcmcurl.a(openssl.c.o): In function `sk_X509_pop':
openssl.c:(.text+0x157): undefined reference to `OPENSSL_sk_pop'
lib/libcmcurl.a(openssl.c.o): In function `sk_X509_pop_free':
openssl.c:(.text+0x17c): undefined reference to `OPENSSL_sk_pop_free'
lib/libcmcurl.a(openssl.c.o): In function `sk_GENERAL_NAME_num':
openssl.c:(.text+0x197): undefined reference to `OPENSSL_sk_num'
lib/libcmcurl.a(openssl.c.o): In function `sk_GENERAL_NAME_value':
openssl.c:(.text+0x1b9): undefined reference to `OPENSSL_sk_value'
lib/libcmcurl.a(openssl.c.o): In function `tap_ssl_key':
openssl.c:(.text+0x22f): undefined reference to `SSL_get_client_random'
openssl.c:(.text+0x24a): undefined reference to `SSL_SESSION_get_master_key'
lib/libcmcurl.a(openssl.c.o): In function `verifyhost':
openssl.c:(.text+0x1eb4): undefined reference to `ASN1_STRING_get0_data'
openssl.c:(.text+0x211d): undefined reference to `ASN1_STRING_get0_data'
lib/libcmcurl.a(openssl.c.o): In function `ossl_connect_step1':
openssl.c:(.text+0x31f5): undefined reference to `TLS_client_method'
openssl.c:(.text+0x3556): undefined reference to `SSL_CTX_set_options'
lib/libcmcurl.a(openssl.c.o): In function `get_cert_chain':
openssl.c:(.text+0x4929): undefined reference to `X509_get_version'
openssl.c:(.text+0x4b81): undefined reference to `X509_get0_extensions'
openssl.c:(.text+0x4ba1): undefined reference to `X509_get0_notBefore'
openssl.c:(.text+0x4c26): undefined reference to `X509_get0_notAfter'
openssl.c:(.text+0x4d10): undefined reference to `EVP_PKEY_get0_RSA'
openssl.c:(.text+0x4d39): undefined reference to `RSA_get0_key'
openssl.c:(.text+0x4e1d): undefined reference to `EVP_PKEY_get0_DSA'
openssl.c:(.text+0x4e48): undefined reference to `DSA_get0_pqg'
openssl.c:(.text+0x4e66): undefined reference to `DSA_get0_key'
openssl.c:(.text+0x4f17): undefined reference to `EVP_PKEY_get0_DH'
openssl.c:(.text+0x4f42): undefined reference to `DH_get0_pqg'
openssl.c:(.text+0x4f60): undefined reference to `DH_get0_key'
lib/libcmcurl.a(openssl.c.o): In function `pkp_pin_peer_pubkey':
openssl.c:(.text+0x51dc): undefined reference to `X509_get_X509_PUBKEY'
openssl.c:(.text+0x5227): undefined reference to `X509_get_X509_PUBKEY'
lib/libcmcurl.a(openssl.c.o): In function `servercert':
openssl.c:(.text+0x54e4): undefined reference to `X509_get0_notBefore'
openssl.c:(.text+0x556d): undefined reference to `X509_get0_notAfter'
lib/libcmcurl.a(openssl.c.o): In function `Curl_ossl_version':
openssl.c:(.text+0x6a09): undefined reference to `OpenSSL_version_num'
collect2: error: ld returned 1 exit status
Utilities/cmcurl/CMakeFiles/LIBCURL.dir/build.make:87: recipe for target 'Utilities/cmcurl/LIBCURL' failed
make[2]: *** [Utilities/cmcurl/LIBCURL] Error 1
CMakeFiles/Makefile2:1527: recipe for target 'Utilities/cmcurl/CMakeFiles/LIBCURL.dir/all' failed
make[1]: *** [Utilities/cmcurl/CMakeFiles/LIBCURL.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

在更新openssl至1.1版本后,问题并没有解决,
做了以下工作
1.添加环境变量
2.将openssl的库连接到/usr/lib文件内
但都不可行
受这篇博客的启发,开始检查自己openssl的软连接是否连接正确

nm -D libcrypto.so.1.1//需要进入/usr/lib文件内

发现连接已断开,如下图所示
进入到/usr/local/openssl/lib文件夹内,重新建立软连接

sudo ln -s libcrypto.a /usr/lib/libcrypto.a

发现新建立的链接还是显示已断开,受这片博客启发
写全路径,更改代码如下,建立链接成功

ln -s /usr/local/openssl/lib/libcrypto.a /usr/lib/libcrypto.a

发现问题还是没有解决,还是会显示上面的问题,四处找法子都没有解决,终于自己摸索出来了一条可行的法子。

解决方法:

在执行./bootstrap时会输出openssl的信息

Looking for gethostname - found
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.1.0")
-- Looking for openssl/crypto.h
-- Looking for openssl/crypto.h - found
-- Looking for openssl/engine.h
-- Looking for openssl/engine.h - found
-- Looking for openssl/err.h
-- Looking for openssl/err.h - found
-- Looking for openssl/pem.h
-- Looking for openssl/pem.h - found
-- Looking for openssl/rsa.h
-- Looking for openssl/rsa.h - found
-- Looking for openssl/ssl.h
-- Looking for openssl/ssl.h - found
-- Looking for openssl/x509.h
-- Looking for openssl/x509.h - found
-- Looking for openssl/rand.h
-- Looking for openssl/rand.h - found

可以发现他是在/usr/lib/x86_64-linux-gnu/libcrypto.so这个路径下调用openssl,所以把这个路径的openssl1.0.0相关的库删除,将openssl1.1的库连接到这个地址就可以成功!
折腾了我一晚上加一上午,终于搞定了!!!

In function `sk_X509_EXTENSION_num': openssl.c:(.text+0xdf): undefined reference to `OPENSSL_sk_num'相关推荐

  1. /tmp/ccAceHhY.o: In function `main': main.c:(.text+0xc7): undefined reference to `dlopen' main.c:

    写一些调用dlopen函数的程序,编译的时候总是报: /tmp/ccAceHhY.o: In function `main': main.c:(.text+0xc7): undefined refer ...

  2. thread_join.c:(.text+0x6f): undefined reference to `pthread_create' 问题的解决

    今天在测试一个线程例子时,结果出现如下错误 [root@tom fzf]# gcc thread_join.c -o thread_join /tmp/cc1HozRv.o: In function ...

  3. gcc报(.text+0x24): undefined reference to `main‘collect2: error: ld returned 1 exit status解决方法

    我已经记不清自己为什么这样解决了,重新搜索了一下也没发现类似的答案. 由于实验需要,我需要编译这个例子: https://github.com/grimm-co/GEARSHIFT/blob/trun ...

  4. 关于移植jSON编译时报错sbrkr.c:(.text+0xc): undefined reference to `_sbrk'处理

    最近有个项目需要用到jSON函数,在移植了jSON后编译报错如下:sbrkr.c:(.text+0xc): undefined reference to `_sbrk'. 通过百度查询知道原来是GCC ...

  5. ompparticles.cpp:(.text+0x322): undefined reference to `omp_set_num_threads'

    参考 http://www.code-by.org/viewtopic.php?f=54&t=163 转载于:https://www.cnblogs.com/paktc/p/5999033.h ...

  6. TESTmain.c:(.text+0x15): undefined reference to `TESTscan‘

    c引用外部文件出错 因为需要在头文件中加上相对路径, 比如: 修改前: //主程序 #include <stdio.h> #include <ctype.h> #include ...

  7. 解决引用openssl静态库libcrypto.a和libssl.a出现undefined reference to错误的问题

    解决引用openssl静态库libcrypto.a和libssl.a出现undefined reference to错误的问题 最近在做使用openssl链接http和https的项目,编译时出现以下 ...

  8. openssl静态库使用出错undefined reference to `COMP_CTX_new‘

    有个项目又要用到openssl,在Linux下编译的时候没注意,报了以下错误 libcrypto.a(threads_pthread.o): In function `fork_once_func': ...

  9. pow函数gcc编译提示 undefined reference to `power' 的解决办法

    一个程序,用了pow函数,头文件中也包含了<math.h>文件,但是在编译时,gcc -o ippanduan ippanduan.c  一直提示如下错误: /tmp/ccARJLRg.o ...

最新文章

  1. MySQL数据copy
  2. 如何在CentOS 7上使用uWSGI和Nginx来运行Django应用程序
  3. python 模拟微信浏览器请求_使用Chrome修改user agent模拟微信内置浏览器
  4. 这个文件传输神器完爆 FTP
  5. 计算机心得300,计算机实训总结计算机实训心得300
  6. 对几个submission文件迅速做voting操作
  7. 云服务器加密机,如何选择云服务器密码机
  8. 图像处理中的卷积与模板
  9. su - 提示失败问题[su方式]
  10. Oracle数据库一致性读的原理
  11. CONTINUAL LEARNING FOR AUTOMATED AUDIO CAPTIONING USING THE LEARNING WITHOUT FORGETTING APPROACH
  12. 实力推荐:现网全能屏幕录像和编辑的软件
  13. 【米勒拉宾模板】Palindromic Primes
  14. 星岚技术 Win10 x64 纯净版 V2021.5【带驱动包】
  15. 微信小程序返回上一页各种方法
  16. 一个小灯泡带我了解放大电路
  17. 计算机表格 求差,教大家Excel2013中表格求差函数公式怎么使用
  18. java猜拳程序_Java基础之:猜拳小程序
  19. Matlab中的\ 和/和pinv的关系以及运算
  20. 正宗干货!关于Apple Watch官方提到的10个设计小技巧

热门文章

  1. 回收站删除的文件恢复,保姆级教学
  2. Java 对国际化 (i18n) 的支持资源包的调用
  3. c语言怎么录入上下作用,c语言怎么使用键盘上的上下左右键
  4. Android Studio 笔记4.2 安卓触摸事件
  5. sm2格式数字信封加解密详解
  6. python数据库操作——连接SQLite
  7. 车辆运动学模型—bicycle model
  8. 2013年度总结:生活与工作都不容易,压力山大
  9. 数据库置疑的处理步骤(以数据库'shop07'为例)
  10. win10显示隐藏文件_如何在Mac上显示和查看隐藏的文件/文件夹