无法找到 CURL(缺少:CURL_LIBRARY CURL_INCLUDE_DIR)和 CMAKE_C_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib

无法找到 CURL(缺少:CURL_LIBRARY CURL_INCLUDE_DIR)和 CMAKE_C_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib

我遵循安装因素

我下载了最新版本的3.9.6 tar.gz包。

在此输入图像描述

但我收到以下错误:

[root@localhost release]# cmake ..
-- Could NOT find CURL (missing: CURL_LIBRARY CURL_INCLUDE_DIR)
CMake Error at CMakeLists.txt:69 (find_package):
  By not providing "FindLeatherman.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "Leatherman", but CMake did not find one.

  Could not find a package configuration file provided by "Leatherman" with
  any of the following names:

    LeathermanConfig.cmake
    leatherman-config.cmake

  Add the installation prefix of "Leatherman" to CMAKE_PREFIX_PATH or set
  "Leatherman_DIR" to a directory containing one of the above files.  If
  "Leatherman" provides a separate development package or SDK, be sure it has
  been installed.


-- Configuring incomplete, errors occurred!
See also "/tools/puppet/facter-3.9.6/release/CMakeFiles/CMakeOutput.log".
[root@localhost release]#

CMakeLists.txt:69

CMAKE_C_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib

我的 CentOS 7.2 服务器中有curl,


[root@localhost release]# curl --version
curl 7.29.0 (x86_64-redhat-linux-gnu) libcurl/7.29.0 NSS/3.36 zlib/1.2.7 libidn/1.28 libssh2/1.4.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp
Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz unix-sockets

我已经尝试安装libcurl4-openssl-dev但没有包:

yum  install libcurl4-openssl-dev -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
No package libcurl4-openssl-dev available.
Error: Nothing to do

答案1

Centos 使用不同的包名称。 Debian/Ubuntu 软件包名称是libcurl4-openssl-dev.然而,libcurl-devel在 CentOS 上提供了相同的文件以及更多。试试这个:

sudo yum install libcurl-devel 

此外,您还可以搜索可用的软件包,如下例所示:

yum search libcurl

YUM 命令备忘单

相关内容