2017-10-14 62 views
0

我想爲Django項目安裝GEOS,並遵循Docs,但在Ubuntu 16.04 Xenial上編譯時出現此錯誤。有一些修復它here但它也沒有奏效。以下是我按照官方Django文檔運行「make」時得到的錯誤。不能使Gdal 1.11.2工作從二進制文件

錯誤:

gdalserver.c: In function 'CreateSocketAndBindAndListen': 
gdalserver.c:125:21: error: storage size of 'sHints' isn't known 
    struct addrinfo sHints; 
        ^
gdalserver.c:127:31: error: invalid application of 'sizeof' to incomplete type 'struct addrinfo' 
    memset(&sHints, 0, sizeof(struct addrinfo)); 
          ^
gdalserver.c:130:23: error: 'AI_PASSIVE' undeclared (first use in this function) 
    sHints.ai_flags = AI_PASSIVE; 
        ^
gdalserver.c:130:23: note: each undeclared identifier is reported only once for each function it appears in 
gdalserver.c:133:12: warning: implicit declaration of function 'getaddrinfo' [-Wimplicit-function-declaration] 
    nRet = getaddrinfo(NULL, pszService, &sHints, &psResults); 
      ^
gdalserver.c:136:48: warning: implicit declaration of function 'gai_strerror' [-Wimplicit-function-declaration] 
     fprintf(stderr, "getaddrinfo(): %s\n", gai_strerror(nRet)); 
               ^
gdalserver.c:136:25: warning: format '%s' expects argument of type 'char *', but argument 3 has type 'int' [-Wformat=] 
     fprintf(stderr, "getaddrinfo(): %s\n", gai_strerror(nRet)); 
         ^
gdalserver.c:142:39: error: dereferencing pointer to incomplete type 'struct addrinfo' 
      psResultsIter = psResultsIter->ai_next) 
            ^
gdalserver.c:163:5: warning: implicit declaration of function 'freeaddrinfo' [-Wimplicit-function-declaration] 
    freeaddrinfo(psResults); 
    ^
gdalserver.c:125:21: warning: unused variable 'sHints' [-Wunused-variable] 
    struct addrinfo sHints; 
        ^
../GDALmake.opt:565: recipe for target 'gdalserver.lo' failed 
make[1]: *** [gdalserver.lo] Error 1 
make[1]: Leaving directory '/home/osboxes/gdal-1.11.2/apps' 
GNUmakefile:69: recipe for target 'apps-target' failed 
make: *** [apps-target] Error 2 

回答

5

嘗試版本2.2.2 GDAL。您嘗試的版本未被維護。同時嘗試升級您使用的所有軟件版本。有補丁和升級的原因,所以始終保持更新版本。