root@68b38fa8ebaa:# curl --version
curl 7.58.0 (x86_64-pc-linux-gnu) libcurl/7.58.0 OpenSSL/1.1.1 zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3
Release-Date: 2018-01-24
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy PSL
root@68b38fa8ebaa:# ls /usr/lib | grep curl
root@68b38fa8ebaa:# ls /usr/bin | grep curl # bin目录下
curl
libcurl.so
curl已安装,但仍然报错
/usr/bin/ld: cannot find -lcurl
解决:
root@68b38fa8ebaa:# apt-get install libcurl-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libcurl-dev is a virtual package provided by:
libcurl4-openssl-dev 7.58.0-2ubuntu3.12
libcurl4-nss-dev 7.58.0-2ubuntu3.12
libcurl4-gnutls-dev 7.58.0-2ubuntu3.12
You should explicitly select one to install.
E: Package 'libcurl-dev' has no installation candidate
安装:libcurl4-openssl-dev
root@68b38fa8ebaa:# apt-get install libcurl4-openssl-dev
root@68b38fa8ebaa:# find /usr/ -name libcurl.so
/usr/lib/x86_64-linux-gnu/libcurl.so
/usr/bin/libcurl.so
well done,编译通过,没有报错了
-- Configuring done
-- Generating done
-- Build files have been written to:
/XXX/build
[ 11%] Linking CXX shared library XXX.so
[100%] Built target XXX