Debian 9: fatal error: 'curl/curl.h' file not found, even though libcurl4-openssl-dev is installed?

Debian 9: fatal error: 'curl/curl.h' file not found, even though libcurl4-openssl-dev is installed?

基本上如标题所说:Debian 9:致命错误:'curl/curl.h' 找不到文件,即使安装了 libcurl4-openssl-dev?

config.log:

configure:5741: checking for curl-config
configure:5759: found /usr/bin/curl-config
configure:5771: result: /usr/bin/curl-config
configure:5782: checking for the version of libcurl
configure:5789: result: 7.52.1
configure:5796: checking for libcurl >= version 7.15.2
configure:5809: result: yes
configure:5850: checking whether libcurl is usable
configure:5884: aarch64-linux-android-clang -o conftest -O3 -mfpu=neon    conftest.c -lcurl  >&5
conftest.c:31:10: fatal error: 'curl/curl.h' file not found
#include <curl/curl.h>
         ^~~~~~~~~~~~~
1 error generated.
configure:5884: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "cpuminer"
| #define PACKAGE_TARNAME "cpuminer"
| #define PACKAGE_VERSION "1.0.3"
| #define PACKAGE_STRING "cpuminer 1.0.3"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define PACKAGE "cpuminer"
| #define VERSION "1.0.3"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_SYS_ENDIAN_H 1
| #define HAVE_SYS_PARAM_H 1
| #define HAVE_SYSLOG_H 1
| #define HAVE_DECL_BE32DEC 0
| #define HAVE_DECL_LE32DEC 0
| #define HAVE_DECL_BE32ENC 0
| #define HAVE_DECL_LE32ENC 0
| #define HAVE_ALLOCA_H 1
| #define HAVE_ALLOCA 1
| #define HAVE_GETOPT_LONG 1
| /* end confdefs.h.  */
| #include <curl/curl.h>
| int
| main ()
| {
| 
| /* Try and use a few common options to force a failure if we are
|    missing symbols or can't link. */
| int x;
| curl_easy_setopt(NULL,CURLOPT_URL,NULL);
| x=CURL_ERROR_SIZE;
| x=CURLOPT_WRITEFUNCTION;
| x=CURLOPT_WRITEDATA;
| x=CURLOPT_ERRORBUFFER;
| x=CURLOPT_STDERR;
| x=CURLOPT_VERBOSE;
| if (x) {;}
| 
|   ;
|   return 0;
| }
configure:5898: result: no
configure:5989: error: Missing required libcurl >= 7.15.2

headers 在 /usr/include/x86_64-linux-gnu/curl/ 中,我在 /usr/include/curl 和 /usr/local/include/curl 中都建立了符号链接。

我做过什么傻事吗?我错过了一步吗?

您可能需要在编译时指定包含目录。

要列出您的默认包含路径,您可以 运行 命令

# clang -xc -E -v -

这将列出搜索 header 的位置。例如

#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-linux-gnu/7/include
 /usr/local/include
 /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.

漂亮的工具 pkg-config 可以帮助您找到 libcurl 所需的路径。

# pkg-config --cflags libcurl
-I/usr/include/x86_64-linux-gnu

从这里我们看到您的路径包含在内,但抱怨的编译器是 aarch64-linux-android-clang.

可能的答案

尝试运行

# aarch64-linux-android-clang -xc -E -v -

看看是否表明搜索的路径不包含有问题的 header。您可能还需要为 aarch64 获取 headers(和 libcurl)。

祝你好运!