Linux /usr/bin/ld: 找不到 -lcurl

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5136479/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-05 03:03:10  来源:igfitidea点击:

/usr/bin/ld: cannot find -lcurl

linuxubuntulinker

提问by Michiel de Mare

I'm trying to install the ruby gem for curl (curb) on Ubuntu 10.10, but during the installation, I get the error:

我正在尝试在 Ubuntu 10.10 上为 curl (curb) 安装 ruby​​ gem,但是在安装过程中,出现错误:

/usr/bin/ld: cannot find -lcurl

But curl is installed! apt-get install curl says I've got the newest version. There is no curl-dev either.

但是curl安装了!apt-get install curl 说我有最新版本。也没有 curl-dev。

I'm getting these kinds of errors all the time, with curl, with libxml, with readline, and I have no idea what's going on. Something is wrong with my installation of Ubuntu, but I don't know what, I don't know where to look, I don't know what to google for, and I don't know how to fix it.

我一直在收到这些类型的错误,使用 curl、使用 libxml、使用 readline,我不知道发生了什么。我安装的 Ubuntu 出了点问题,但我不知道是什么,我不知道去哪里找,我不知道要谷歌搜索什么,我不知道如何修复它。

Help would be deeply appreciated.

帮助将不胜感激。

EDIT: this is in my /usr/lib dir for libcurl:

编辑:这是在我的 /usr/lib 目录中的 libcurl:

lrwxrwxrwx  1 root root      19 2011-02-18 23:15 libcurl-gnutls.so.3 -> libcurl-gnutls.so.4
lrwxrwxrwx  1 root root      23 2011-02-18 23:15 libcurl-gnutls.so.4 -> libcurl-gnutls.so.4.2.0
-rw-r--r--  1 root root  339880 2010-06-23 09:07 libcurl-gnutls.so.4.2.0
lrwxrwxrwx  1 root root      12 2011-02-18 23:14 libcurl.so.3 -> libcurl.so.4
lrwxrwxrwx  1 root root      16 2011-02-18 23:14 libcurl.so.4 -> libcurl.so.4.2.0
-rw-r--r--  1 root root  360904 2010-06-23 09:07 libcurl.so.4.2.0

采纳答案by Kevin Cathcart

You need the libcurl3-dev package. Curl is just the command line utility. The library is libcurl3, and it has a -dev package. (It seems to be a virtual package in Maverick, redirecting to libcurl4-openssl-dev, but that should still work or the virtual package would not have been provided.) Indeed from your lib directory I can see that libcurl3 is merely a symbolic link to libcurl4. (libcurl3-dev may not be available in the future, so use libcurl4-openssl-dev directly).

您需要 libcurl3-dev 包。Curl 只是命令行实用程序。库是 libcurl3,它有一个 -dev 包。(它似乎是 Maverick 中的一个虚拟包,重定向到 libcurl4-openssl-dev,但这应该仍然有效,否则不会提供虚拟包。)确实从你的 lib 目录中我可以看到 libcurl3 只是一个符号链接到 libcurl4。(libcurl3-dev 以后可能不可用,所以直接使用 libcurl4-openssl-dev)。