Compilation 数组大小'__卷曲度规则01';是否定的

Compilation 数组大小'__卷曲度规则01';是否定的,compilation,git,curl,Compilation,Git,Curl,我在编译GIT时遇到了一个错误。我在Google和GIT源代码中搜索过类似的问题,但没有找到任何帮助 最初我收到了以下错误 root@teemo:/usr/src/git# make prefix=/usr install install-doc install-html install-info; CC http-push.o In file included from cache.h:39:0, from http-push.c:1: /usr/in

我在编译GIT时遇到了一个错误。我在Google和GIT源代码中搜索过类似的问题,但没有找到任何帮助

最初我收到了以下错误

root@teemo:/usr/src/git# make prefix=/usr install install-doc install-html install-info;
    CC http-push.o
In file included from cache.h:39:0,
                 from http-push.c:1:
/usr/include/zlib.h:34:19: fatal error: zconf.h: No such file or directory
 #include "zconf.h"
                   ^
compilation terminated.
make: *** [http-push.o] Error 1
我在
/usr/include/
中创建了一个指向丢失文件的符号链接,如下所示(在我安装/编译了最新/开发版本之后)

这让我想到了当前的问题,我对如何解决这个问题感到困惑。如果有人能提供建议,我们将不胜感激

root@teemo:/usr/src/git# make prefix=/usr install install-doc install-html install-info;
    CC http-push.o
In file included from /usr/include/curl/curl.h:35:0,
                 from http.h:6,
                 from http-push.c:5:
/usr/include/curl/curlrules.h:142:3: error: size of array '__curl_rule_01__' is negative
   __curl_rule_01__
   ^
/usr/include/curl/curlrules.h:152:3: error: size of array '__curl_rule_02__' is negative
   __curl_rule_02__
   ^
make: *** [http-push.o] Error 1

curlrules.h
中向上阅读。作为检查数据类型大小的测试的一部分,故意强制执行该错误

 * NOTE 2
 * ------
 *
 * Some of the following compile time checks are based on the fact
 * that the dimension of a constant array can not be a negative one.
 * In this way if the compile time verification fails, the compilation
 * will fail issuing an error. The error description wording is compiler
 * dependent but it will be quite similar to one of the following:
 *
 *   "negative subscript or subscript is too large"
 *   "array must have at least one element"
 *   "-1 is an illegal array size"
 *   "size of array is negative"
 *
 * If you are building an application which tries to use an already
 * built libcurl library and you are getting this kind of errors on
 * this file, it is a clear indication that there is a mismatch between
 * how the library was built and how you are trying to use it for your
 * application. Your already compiled or binary library provider is the
 * only one who can give you the details you need to properly use it.
您的libcurl版本使用了与当前git版本不同的选项。(可能是32位对64位)


了解您所在的平台和构建选项可能足以帮助其他人解决此问题。如果这是常见的情况,并且您在Linux或其他受支持的平台上,那么使用本机软件管理安装预构建的二进制文件就更容易了

如果系统报告
\uuuuucurl\u rule\u 01\uuuuuu
\uuuuuucurl\u rule\u 02\uuuuuuu
为负值,则对
/usr/include/curl/curlbuild.h
进行以下更改:

添加以下行:

  • define CURL\u size\u LONG 4
  • define CURL\u SIZEOF\u CURL\u OFF\u T 4

(或替换已定义的类似行)

谢谢提示,我想我应该先检查一下。尽管如此,我的
curlrules.h
中没有这个注释,我正在运行7.35.0版。github上的历史记录看起来像是从第一个版本开始就出现了,但也许你的注释已经修改过了。尽管如此,您可以在上查看整个文件,或下载最新版本。我接受了-虽然这并不能解决问题,但它促使我使用正确的资源/路径重新编译curl。我认为这是解决方案。测试是为了查看libcurl二进制文件是否与当前构建环境的配置匹配。它检测到它没有,然后出错。因此,解决方法是要么获得一个匹配的新curl二进制构建,要么只是在构建应用程序时使用的相同环境中包含building curl。在我的例子中,我无意中使用了源目录的include路径,而不是build目录中的include路径。当你的眼睛疲劳的时候,这样的事情是很难发现的…顺便说一句,这些文件在libcurl中被删除了,看到这个问题了吗--
 * NOTE 2
 * ------
 *
 * Some of the following compile time checks are based on the fact
 * that the dimension of a constant array can not be a negative one.
 * In this way if the compile time verification fails, the compilation
 * will fail issuing an error. The error description wording is compiler
 * dependent but it will be quite similar to one of the following:
 *
 *   "negative subscript or subscript is too large"
 *   "array must have at least one element"
 *   "-1 is an illegal array size"
 *   "size of array is negative"
 *
 * If you are building an application which tries to use an already
 * built libcurl library and you are getting this kind of errors on
 * this file, it is a clear indication that there is a mismatch between
 * how the library was built and how you are trying to use it for your
 * application. Your already compiled or binary library provider is the
 * only one who can give you the details you need to properly use it.