2016-02-03 10 views
6

Mam problem z błędem podczas próby kompilacji GIT. Szukałem informacji o Google i źródle/problemach z GIT dla podobnych problemów, ale nie znalazłem nic, co mogłoby mi pomóc.rozmiar tablicy "__curl_rule_01__" jest ujemny

Początkowo otrzymałem następujący błąd

[email protected]:/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 

Stworzyłem dowiązanie symboliczne wewnątrz /usr/include/ do brakującego pliku w następujący sposób (po tym, jak zainstalować/skompilowany najnowszej wersji/rozwój)

[email protected]:/usr/src/git# ln -s /usr/include/x86_64-linux-gnu/zconf.h /usr/include 

Co prowadzi mnie do aktualnego problemu, który jestem zdezorientowany, jak rozwiązać. Gdyby ktoś mógł doradzić, byłoby to bardzo cenne.

[email protected]:/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 

Odpowiedz

8

Czytaj wyżej w curlrules.h. Ten błąd jest celowo wymuszany jako część testu sprawdzającego rozmiar typów danych.

* 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. 

Twoja wersja libcurl została zbudowana w oparciu o różne opcje niż w obecnej wersji git. (może to być 32 lub 64-bitowe)

Wiedza na temat platformy, na której się znajdujesz i opcje jej budowy mogą być wystarczające, aby pomóc w jej rozwiązaniu. Jeśli tak jest w powszechnym przypadku i korzystasz z Linuksa lub innej obsługiwanej platformy, łatwiej będzie zainstalować wstępnie skonstruowany plik binarny za pomocą rodzimego zarządzania oprogramowaniem. Git downloads

+0

Dzięki za podpowiedź, chyba powinienem był najpierw to sprawdzić. Chociaż okazuje się, że nie mam tej notatki w mojej "curlrules.h" i mam uruchomioną wersję ** 7.35.0 ** – ash

+0

Historia na githubie wygląda na to, że komentarz był tam od pierwszej wersji, ale może twój został zmodyfikowany. Niemniej jednak cały plik można zobaczyć na stronie https://github.com/curl/curl/blob/master/include/curl/curlrules.h lub pobrać najnowszą wersję. –

+0

Zaakceptowałem - chociaż to nie rozwiązuje problemu, zachęciło mnie to do ponownego przekompilowania curl z właściwymi zasobami/ścieżkami – ash

0

W systemie kazuistycznych __curl_rule_01__ lub __curl_rule_02__ jest ujemna dokonać następujących zmian /usr/include/curl/curlbuild.h:

dodać następujące linie:

  • define CURL_SIZEOF_LONG 4
  • define CURL_SIZEOF_CURL_OFF_T 4

(lub wymienić podobne linie, jeśli są już zdefiniowane)

+1

Btw, te pliki plików zostały usunięte w libcurl, zobacz ten problem - https://github.com/curl/curl/pull/1383 –

Powiązane problemy