Ubuntu - #include< curl / curl.h>无此文件或目录 [英] Ubuntu - #include <curl/curl.h> no such file or directory

查看:6649
本文介绍了Ubuntu - #include< curl / curl.h>无此文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Ubuntu上使用Curl开发一个C程序。我使用Eclipse Kepler。
我已经使用

I'm developping a C-program using Curl on Ubuntu. I'm using Eclipse Kepler. I have installed the curl library using


apt-get install libcurl4-gnutls-dev

apt-get install libcurl4-gnutls-dev

我检查过一切是否都是正确的。

And I checked if everything is allright usign


ls -l / usr / include / curl

ls -l /usr/include/curl

我有


total 172

total 172

-rw-r - r-- 1 root root 7065 janv。 31 16:49 curlbuild.h

-rw-r--r-- 1 root root 7065 janv. 31 16:49 curlbuild.h

-rw-r - r-- 1 root root 81593 janv。 31 16:49 curl.h

-rw-r--r-- 1 root root 81593 janv. 31 16:49 curl.h

-rw-r - r-- 1 root root 8901 janv。 31 16:49 curlrules.h

-rw-r--r-- 1 root root 8901 janv. 31 16:49 curlrules.h

-rw-r - r-- 1 root root 2741 janv。 31 16:49 curlver.h

-rw-r--r-- 1 root root 2741 janv. 31 16:49 curlver.h

-rw-r - r-- 1 root root 3472 janv。 31 16:49 easy.h

-rw-r--r-- 1 root root 3472 janv. 31 16:49 easy.h

-rw-r - r-- 1 root root 2790 janv。 31 16:49 mprintf.h

-rw-r--r-- 1 root root 2790 janv. 31 16:49 mprintf.h

-rw-r - r-- 1 root root 12981 janv。 31 16:49 multi.h

-rw-r--r-- 1 root root 12981 janv. 31 16:49 multi.h

-rw-r - r-- 1根根1330 janv。 31 16:49 stdcheaders.h

-rw-r--r-- 1 root root 1330 janv. 31 16:49 stdcheaders.h

-rw-r - r-- 1 root root 36048 janv。 31 16:49 typecheck-gcc.h

-rw-r--r-- 1 root root 36048 janv. 31 16:49 typecheck-gcc.h

虽然我的curl.h文件在那里,但是当我试图构建我的程序:

Although my curl.h file is there, Eclipse wrote this message when I tried to build my program :


致命错误:curl / curl.h:没有这样的文件或目录
编译终止。

fatal error: curl/curl.h: No such file or directory compilation terminated.

我忘记设置什么?一切看起来不错! :'(
谢谢!

What did I forget to set ? Everything looks good ! :'( Thanks !

推荐答案

C编译器(实际上是预处理器) / usr / include ,因此如果包含文件 curl.h 位于 / usr / include / curl / ,并包含在 #include< curl / curl.h> ,C编译器中,例如

C compilers' (preprocessors', actually) standard include file searching paths should include /usr/include, therefore if the include file curl.h is located in /usr/include/curl/ and is included by #include <curl/curl.h>, C compilers, such as gcc, should be able to find it without any problem.

但是,您正在使用 / gcc下的工具链, opt / toolchains / arm-2011.V2 / bin ,我想这是一个交叉编译工具链。在这种情况下,你不能使用curl库,因为这是为主机系统,这可能是一个x86或x86_64系统。

However, you are using a toolchain under /opt/toolchains/arm-2011.V2/bin, I guess it is a cross-compiling toolchain. In this case, you cannot use the curl library, because which is for the host system, which probably is a x86 or x86_64 system.

要在您的ARM项目中使用curl库,您需要为ARM安装curl库开发包软件存储库没有这些软件包,那么您需要下载源代码,并为ARM首先进行交叉编译。

To use curl library in your ARM project, you need to install the curl library development package for ARM, if that is possible. If the software repositories do not have those packages, then you need to download the source code and cross-compile it for ARM first.

这篇关于Ubuntu - #include&lt; curl / curl.h&gt;无此文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆