仍然得到“卷曲/ curl.h:没有这样的文件或目录”尽管所有的看起来正确 [英] Still get 'curl/curl.h: No such file or directory' in spite of all looks proper

查看:437
本文介绍了仍然得到“卷曲/ curl.h:没有这样的文件或目录”尽管所有的看起来正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows上安装卷曲7.28.0 curl-7.28.1-devel-mingw32.zip 通过的MinGW 控制台默认目录一样:

I installed on windows curl 7.28.0 from curl-7.28.1-devel-mingw32.zip through minGW console to default directory like:

./config && make && make install

所有需要的标题(又名 curl.h,types.h中... )我看到C:\\ MinGW的\\ MSYS \\ 1.0 \\本地\\包括\\卷曲

libcurl.pc 放在 C:\\ MinGW的\\ MSYS \\ 1.0 \\本地\\ lib目录\\ pkgconfig \\

libcurl.a libcurl.dll.a libcurl.la 放在 C:\\ MinGW的\\ MSYS \\ 1.0 \\本地\\ lib中

我的 download_file.c 文件包括有:

...
#include <curl/curl.h>
#include <curl/types.h>
#include <curl/easy.h>
...

我试图编译 C code。与随后命令通过 GCC

I try to compile the C code with followed command through gcc:

$ gcc -IC:/MinGW/msys/1.0/include/ 
      -IC:/MinGW/msys/1.0/local/include/curl
      -IC:/MinGW/msys/1.0/local/lib/pkgconfig
           -o download_file download_file.c -llibcurl -lcurl

使用绝对路径得到同样的错误:

with absolute path get the same error:

gcc -I/include/
    -I/local/include/curl
    -I/local/lib/pkgconfig
        -o download_file download_file.c -llibcurl -lcurl

但我仍然得到一个错误:

But I still get an error:

download_file.c:21:23: fatal error: curl/curl.h: No such file or directory compilation terminated.

行21 的#include&LT;卷曲/ curl.h&GT;

我做错了什么?请帮忙。

What I did wrong? Please help.

推荐答案

您有卷曲/ 目录中的源$ C ​​$ C,但的选项。

You have the curl/ directory in the source code, but also in the option.

看来选项应该指出,在卷曲/ 更高级别的目录,所以它应该是这样的:

It seems the option should point out the higher-level directory in which curl/ is, so it should be something like:

-I/local/include/

这篇关于仍然得到“卷曲/ curl.h:没有这样的文件或目录”尽管所有的看起来正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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