搜索

451

主题

663

帖子

5297

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
5297
QQ
发表于 2021-4-8 12:34:33 9362 浏览 1 回复

fatal error: openssl/bio.h

出现这个或者fatal error: openssl/名单.h: No such file or directory。都是没有安装libssl-dev~

libssl-dev包含libraries, header files and manpages,他是openssl的一部分,而openssl对ssl进行了实现~

解决方案:

  1. 使用sudo apt-get install libssl-dev来安装libssl-dev即可
复制代码



手机微信同号:13682654092
回复

使用道具 举报

451

主题

663

帖子

5297

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
5297
QQ
 楼主| 发表于 2021-7-14 20:36:44
  1. tangh@XY13:/sda2/tangh/sprd/sprdroidr_trunk_20a$ sudo apt-get install zlib1g-dev
  2. Reading package lists... Done
  3. Building dependency tree      
  4. Reading state information... Done
  5. Some packages could not be installed. This may mean that you have
  6. requested an impossible situation or if you are using the unstable
  7. distribution that some required packages have not yet been created
  8. or been moved out of Incoming.
  9. The following information may help to resolve the situation:

  10. The following packages have unmet dependencies:
  11. zlib1g-dev : Depends: zlib1g (= 1:1.2.8.dfsg-1ubuntu1) but 1:1.2.8.dfsg-1ubuntu1.1 is to be installed
  12. E: Unable to correct problems, you have held broken packages.
复制代码

解决方案:
  1. sudo apt-get install aptitude

  2. sudo aptitude install libssl-dev

  3. dpkg -l *libssl*


复制代码

执行sudo aptitude install libssl-dev前,可以先查看下工具安装情况,我的安装情况如下:
  1. tangh@XY13:/sda2/tangh/sprd/sprdroidr_trunk_20a$ dpkg -l *libssl*
  2. Desired=Unknown/Install/Remove/Purge/Hold
  3. | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
  4. |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
  5. ||/ Name                                                          Version                             Architecture                        Description
  6. +++-=============================================================-===================================-=================
  7. un  libssl-dev                                                    <none>                              <none>                              (no description available)
  8. ii  libssl-doc                                                    1.0.1f-1ubuntu2                     all                                 Secure Sockets Layer toolkit - development documentation
  9. ii  libssl1.0.0:amd64                                             1.0.1f-1ubuntu2.16                  amd64                               Secure Sockets Layer toolkit - shared libraries
复制代码
明显看到信息:un  libssl-dev  <none>  <none>   (no description available)
然后执行安装指令:
sudo aptitude install libssl-dev
注意在安装过程中会提示是否安装或者是否覆盖,请看清楚后再选择,以下是我们的安装过程
  1. tangh@XY13:/sda2/tangh/sprd/sprdroidr_trunk_20a$ sudo aptitude install libssl-dev
  2. The following NEW packages will be installed:
  3.   libssl-dev{b} zlib1g-dev{ab}
  4. 0 packages upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  5. Need to get 1,250 kB of archives. After unpacking 6,764 kB will be used.
  6. The following packages have unmet dependencies:
  7. zlib1g-dev : Depends: zlib1g (= 1:1.2.8.dfsg-1ubuntu1) but 1:1.2.8.dfsg-1ubuntu1.1 is installed.
  8.               Breaks: zlib1g-dev:i386 (!= 1:1.2.8.dfsg-1ubuntu1) but 1:1.2.8.dfsg-1ubuntu1.1 is installed.
  9. zlib1g-dev:i386 : Breaks: zlib1g-dev (!= 1:1.2.8.dfsg-1ubuntu1.1) but 1:1.2.8.dfsg-1ubuntu1 is to be installed.
  10. libssl-dev : Depends: libssl1.0.0 (= 1.0.1f-1ubuntu2) but 1.0.1f-1ubuntu2.16 is installed.
  11. The following actions will resolve these dependencies:

  12.      Keep the following packages at their current version:
  13. 1)     libssl-dev [Not Installed]                        
  14. 2)     zlib1g-dev [Not Installed]                        



  15. Accept this solution? [Y/n/q/?] n
  16. The following actions will resolve these dependencies:

  17.      Downgrade the following packages:                                                  
  18. 1)     libssl1.0.0 [1.0.1f-1ubuntu2.16 (now) -> 1.0.1f-1ubuntu2 (trusty)]               
  19. 2)     zlib1g [1:1.2.8.dfsg-1ubuntu1.1 (now) -> 1:1.2.8.dfsg-1ubuntu1 (trusty)]         
  20. 3)     zlib1g:i386 [1:1.2.8.dfsg-1ubuntu1.1 (now) -> 1:1.2.8.dfsg-1ubuntu1 (trusty)]   
  21. 4)     zlib1g-dev:i386 [1:1.2.8.dfsg-1ubuntu1.1 (now) -> 1:1.2.8.dfsg-1ubuntu1 (trusty)]



  22. Accept this solution? [Y/n/q/?] y
  23. The following packages will be DOWNGRADED:
  24.   libssl1.0.0 zlib1g zlib1g:i386 zlib1g-dev:i386
  25. The following NEW packages will be installed:
  26.   libssl-dev zlib1g-dev{a}
  27. 0 packages upgraded, 2 newly installed, 4 downgraded, 0 to remove and 0 not upgraded.
  28. Need to get 2,370 kB of archives. After unpacking 6,752 kB will be used.
  29. Do you want to continue? [Y/n/?] y
  30. Get: 1 http://cn.archive.ubuntu.com/ubuntu/ trusty/main zlib1g-dev i386 1:1.2.8.dfsg-1ubuntu1 [181 kB]
  31. Get: 2 http://cn.archive.ubuntu.com/ubuntu/ trusty/main zlib1g i386 1:1.2.8.dfsg-1ubuntu1 [57.5 kB]
  32. Get: 3 http://cn.archive.ubuntu.com/ubuntu/ trusty/main zlib1g amd64 1:1.2.8.dfsg-1ubuntu1 [57.1 kB]
  33. Get: 4 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libssl1.0.0 amd64 1.0.1f-1ubuntu2 [825 kB]
  34. Get: 5 http://cn.archive.ubuntu.com/ubuntu/ trusty/main zlib1g-dev amd64 1:1.2.8.dfsg-1ubuntu1 [183 kB]
  35. Get: 6 http://cn.archive.ubuntu.com/ubuntu/ trusty/main libssl-dev amd64 1.0.1f-1ubuntu2 [1,066 kB]
  36. Fetched 2,370 kB in 3s (630 kB/s)     
复制代码
安装完成之后,在执行指令:dpkg -l *libssl*,得到如下结果;

  1. tangh@XY13:/sda2/tangh/sprd/sprdroidr_trunk_20a$ dpkg -l *libssl*
  2. Desired=Unknown/Install/Remove/Purge/Hold
  3. | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
  4. |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
  5. ||/ Name                                                          Version                             Architecture                        Description
  6. +++-=============================================================-===================================-=================
  7. ii  libssl-dev:amd64                                              1.0.1f-1ubuntu2                     amd64                               Secure Sockets Layer toolkit - development files
  8. ii  libssl-doc                                                    1.0.1f-1ubuntu2                     all                                 Secure Sockets Layer toolkit - development documentation
  9. ii  libssl1.0.0:amd64                                             1.0.1f-1ubuntu2                     amd64                               Secure Sockets Layer toolkit - shared libraries
复制代码

ii  libssl-dev:amd64   1.0.1f-1ubuntu2  amd64  Secure Sockets Layer toolkit - development files   
libssl-dev已经安装成功



手机微信同号:13682654092
回复

使用道具 举报

返回列表
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则


登录或注册
快速回复 返回顶部 返回列表