OS 环境:CentOS7.2
利用android studio 2.2 新建了一个C++的环境,打开后cpp下的目录文空,也新建不了C/C++文件,通过gradle同步工程的时候cmake一直报找不到libssl.so.1.0.0。对openssl 1.0.0有依赖。CentOS 7.2 默认的是 openssl 1.0.1。
先看下android studio自带的cmake的依赖库。
[root@localhost bin]# ldd cmake
linux-vdso.so.1 => (0x00007ffd32f6d000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f1f30329000)
libssl.so.1.0.0 => not found
libcrypto.so.1.0.0 => not found
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f1f30020000)
libm.so.6 => /lib64/libm.so.6 (0x00007f1f2fd1e000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f1f2fb07000)
libc.so.6 => /lib64/libc.so.6 (0x00007f1f2f745000)
/lib64/ld-linux-x86-64.so.2 (0x00007f1f30544000)
查看CentOS支持的openssl
[root@localhost Downloads]# yum --showduplicates list openssl
Loaded plugins: axelget, fastestmirror, langpacks, nvidia
No metadata available for base
No metadata available for elrepo
No metadata available for epel
No metadata available for extras
No metadata available for updates
Loading mirror speeds from cached hostfile
* base: mirrors.btte.net
* elrepo: mirrors.tuna.tsinghua.edu.cn
* epel: mirrors.ustc.edu.cn
* extras: mirrors.btte.net
* updates: mirrors.aliyun.com
Installed Packages
openssl.x86_64 1:1.0.1e-51.el7_2.5 @updates
Available Packages
openssl.x86_64 1:1.0.1e-42.el7.9 base
openssl.x86_64 1:1.0.1e-51.el7_2.1 updates
openssl.x86_64 1:1.0.1e-51.el7_2.2 updates
openssl.x86_64 1:1.0.1e-51.el7_2.4 updates
openssl.x86_64 1:1.0.1e-51.el7_2.5 updates
寻找包含libssl.so.1.0.0的安装包:
[root@localhost cmake]# yum provides */libssl.so.1.0.0
Loaded plugins: axelget, fastestmirror, langpacks, nvidia
No metadata available for base
No metadata available for elrepo
No metadata available for epel
No metadata available for extras
No metadata available for updates
Loading mirror speeds from cached hostfile
* base: mirrors.btte.net
* elrepo: mirrors.tuna.tsinghua.edu.cn
* epel: mirrors.ustc.edu.cn
* extras: mirrors.btte.net
* updates: mirrors.aliyun.com
No matches found
/usr/lib64下面有libssl.so.1.0.1e,看看那个包包含这个文件。
[root@soft lib64]# yum provides */libssl.so.1.0.1e
Loaded plugins: axelget, fastestmirror, langpacks, nvidia
No metadata available for adobe-linux-x86_64
No metadata available for base
No metadata available for docker-experimental-repo
No metadata available for docker-main-repo
No metadata available for elrepo
No metadata available for epel
No metadata available for extras
No metadata available for google-chrome
No metadata available for updates
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* elrepo: mirrors.tuna.tsinghua.edu.cn
* epel: mirrors.ustc.edu.cn
* extras: mirrors.163.com
* updates: mirrors.aliyun.com
1:openssl-libs-1.0.1e-42.el7.9.i686 : A general purpose cryptography library with TLS implementation
Repo : base
Matched from:
Filename : /usr/lib/libssl.so.1.0.1e
1:openssl-libs-1.0.1e-42.el7.9.x86_64 : A general purpose cryptography library with TLS implementation
Repo : base
Matched from:
Filename : /usr/lib64/libssl.so.1.0.1e
1:openssl-libs-1.0.1e-51.el7_2.1.i686 : A general purpose cryptography library with TLS implementation
Repo : updates
Matched from:
Filename : /usr/lib/libssl.so.1.0.1e
1:openssl-libs-1.0.1e-51.el7_2.1.x86_64 : A general purpose cryptography library with TLS implementation
Repo : updates
Matched from:
Filename : /usr/lib64/libssl.so.1.0.1e
1:openssl-libs-1.0.1e-51.el7_2.2.i686 : A general purpose cryptography library with TLS implementation
Repo : updates
Matched from:
Filename : /usr/lib/libssl.so.1.0.1e
1:openssl-libs-1.0.1e-51.el7_2.2.x86_64 : A general purpose cryptography library with TLS implementation
Repo : updates
Matched from:
Filename : /usr/lib64/libssl.so.1.0.1e
1:openssl-libs-1.0.1e-51.el7_2.4.i686 : A general purpose cryptography library with TLS implementation
Repo : updates
Matched from:
Filename : /usr/lib/libssl.so.1.0.1e
1:openssl-libs-1.0.1e-51.el7_2.4.x86_64 : A general purpose cryptography library with TLS implementation
Repo : updates
Matched from:
Filename : /usr/lib64/libssl.so.1.0.1e
1:openssl-libs-1.0.1e-51.el7_2.5.i686 : A general purpose cryptography library with TLS implementation
Repo : updates
Matched from:
Filename : /usr/lib/libssl.so.1.0.1e
1:openssl-libs-1.0.1e-51.el7_2.5.x86_64 : A general purpose cryptography library with TLS implementation
Repo : updates
Matched from:
Filename : /usr/lib64/libssl.so.1.0.1e
1:openssl-libs-1.0.1e-51.el7_2.5.x86_64 : A general purpose cryptography library with TLS implementation
Repo : @updates
Matched from:
Filename : /usr/lib64/libssl.so.1.0.1e
在http://rpm.pbone.net/上搜索 openssl1-1.0.0 ,搜到openssl1-1.0.0-4.fc24.x86_64.rpm ,下载安装。
[root@localhost Downloads]# yum install openssl1-1.0.0-4.fc24.x86_64.rpm
Loaded plugins: axelget, fastestmirror, langpacks, nvidia
Examining openssl1-1.0.0-4.fc24.x86_64.rpm: openssl1-1.0.0-4.fc24.x86_64
Marking openssl1-1.0.0-4.fc24.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package openssl1.x86_64 0:1.0.0-4.fc24 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
openssl1 x86_64 1.0.0-4.fc24 /openssl1-1.0.0-4.fc24.x86_64 2.1 M
Transaction Summary
================================================================================
Install 1 Package
Total size: 2.1 M
Installed size: 2.1 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : openssl1-1.0.0-4.fc24.x86_64 1/1
Verifying : openssl1-1.0.0-4.fc24.x86_64 1/1
Installed:
openssl1.x86_64 0:1.0.0-4.fc24
Complete!
[root@localhost Downloads]# yum provides */libssl.so.1.0.0
Loaded plugins: axelget, fastestmirror, langpacks, nvidia
No metadata available for base
No metadata available for elrepo
No metadata available for epel
No metadata available for extras
No metadata available for updates
Loading mirror speeds from cached hostfile
* base: mirrors.btte.net
* elrepo: mirrors.tuna.tsinghua.edu.cn
* epel: mirrors.neusoft.edu.cn
* extras: mirrors.btte.net
* updates: mirrors.aliyun.com
openssl1-1.0.0-4.fc24.x86_64 : Secure Sockets Layer communications libs & utils
Repo : @/openssl1-1.0.0-4.fc24.x86_64
Matched from:
Filename : /usr/lib64/libssl.so.1.0.0
[root@localhost bin]# ldd cmake
./cmake: /lib64/libcrypto.so.1.0.0: no version information available (required by ./cmake)
./cmake: /lib64/libssl.so.1.0.0: no version information available (required by ./cmake)
./cmake: /lib64/libssl.so.1.0.0: no version information available (required by ./cmake)
linux-vdso.so.1 => (0x00007ffe1a1c0000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fb1f92b1000)
libssl.so.1.0.0 => /lib64/libssl.so.1.0.0 (0x00007fb1f9054000)
libcrypto.so.1.0.0 => /lib64/libcrypto.so.1.0.0 (0x00007fb1f8c92000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fb1f898a000)
libm.so.6 => /lib64/libm.so.6 (0x00007fb1f8688000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fb1f8471000)
libc.so.6 => /lib64/libc.so.6 (0x00007fb1f80af000)
/lib64/ld-linux-x86-64.so.2 (0x00007fb1f94cc000)
libz.so.1 => /lib64/libz.so.1 (0x00007fb1f7e99000)
[root@localhost bin]#
安装完毕后查看/usr/lib64下有了libssl.so.1.0.0,android studio ndk相关功能正常,希望google在打包cmake的时候提升下openssl的版本。