2016-02-03 15 views
6

Sono in difficoltà con un errore durante il tentativo di compilare GIT. Ho cercato su Google e i problemi/bug di origine GIT per problemi simili, ma non ho trovato nulla per aiutarmi.la dimensione dell'array '__curl_rule_01__' è negativa

Originariamente ho ricevuto il seguente errore

[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 

ho creato un link simbolico all'interno /usr/include/ al file mancante nel modo seguente (dopo aver installato/compilato l'ultima versione/sviluppo)

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

Il che mi porta al problema attuale, che sono confuso su come risolvere. Se qualcuno potesse consigliarlo sarebbe molto apprezzato.

[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 

risposta

8

Leggere più in alto in curlrules.h. Questo errore è intenzionalmente forzato come parte di un test che controlla la dimensione dei tipi di dati.

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

La versione di libcurl è stato costruito con diverse opzioni di quanto si sta utilizzando nella costruzione git attuale. (potrebbe essere 32 vs 64 bit)

Sapendo su quale piattaforma ci si trova e le opzioni di compilazione potrebbero essere sufficienti altre per contribuire a risolverlo. Se questo è il caso comune e sei su Linux o su un'altra piattaforma supportata, sarebbe più semplice installare un binario precompilato utilizzando la gestione del software nativo. Git downloads

+0

Grazie per il suggerimento, suppongo che avrei dovuto controllare lì prima. Anche se, a quanto pare, non ho questa nota nel mio 'curlrules.h' e sto eseguendo la versione ** 7.35.0 ** – ash

+0

La cronologia su github sembra che quel commento ci sia già dalla prima versione, ma forse il tuo è stato modificato. Tuttavia, è possibile visualizzare l'intero file all'indirizzo https://github.com/curl/curl/blob/master/include/curl/curlrules.h o scaricare l'ultima versione. –

+0

Ho accettato - anche se questo non risolve il problema, mi ha spinto a ricompilare nuovamente con le giuste risorse/percorsi corretti – ash

0

Nel sistema di casi clinici __curl_rule_01__ o __curl_rule_02__ è negativo apportare le seguenti modifiche al /usr/include/curl/curlbuild.h:

aggiungere le seguenti righe:

  • define CURL_SIZEOF_LONG 4
  • define CURL_SIZEOF_CURL_OFF_T 4

(o sostituire linee simili se queste sono già definite)

+1

Btw, questi i file sono stati rimossi in libcurl, vedere questo problema - https://github.com/curl/curl/pull/1383 –

Problemi correlati