简体   繁体   English

GDAL错误:命令'cc'失败,退出状态为1

[英]GDAL error: command 'cc' failed with exit status 1

I am getting increasingly frustrated with this issue, but I have been trying to reinstall GDAL in order to install the new version of QGIS. 我对此问题越来越感到沮丧,但我一直在尝试重新安装GDAL以安装新版本的QGIS。 When I try to install it using pip install GDAL I get the following: 当我尝试使用pip install GDAL安装它时,我得到以下内容:

Installing collected packages: GDAL
  Running setup.py install for GDAL
    building 'osgeo._gdal' extension
    cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I../../port -I../../gcore -I../../alg -I../../ogr/ -I/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/usr/local/lib/python2.7/site-packages/numpy/core/include -I/Library/Frameworks/GDAL.framework/Versions/1.9/include -c extensions/gdal_wrap.cpp -o build/temp.macosx-10.7-x86_64-2.7/extensions/gdal_wrap.o
    extensions/gdal_wrap.cpp:2230:11: warning: explicitly assigning a variable of type 'int' to itself [-Wself-assign]
                        res = SWIG_AddCast(res);
                        ~~~ ^              ~~~
    extensions/gdal_wrap.cpp:2233:11: warning: explicitly assigning a variable of type 'int' to itself [-Wself-assign]
                        res = SWIG_AddCast(res);
                        ~~~ ^              ~~~
    extensions/gdal_wrap.cpp:3515:12: error: use of undeclared identifier 'GDALGetMetadataDomainList'
        return GDALGetMetadataDomainList( self );
               ^
    extensions/gdal_wrap.cpp:3753:5: error: unknown type name 'CPLVirtualMem'
        CPLVirtualMem *vmem;
        ^
    extensions/gdal_wrap.cpp:3761:5: error: unknown type name 'GDALTileOrganization'
        GDALTileOrganization eTileOrganization;
        ^
    extensions/gdal_wrap.cpp:3836:15: warning: unused variable 'start_addr' [-Wunused-variable]
            char* start_addr = (char*)CPLVirtualMemGetAddr( self->vmem ) + start_offset;
                  ^
    extensions/gdal_wrap.cpp:4237:9: error: unknown type name 'CPLVirtualMem'
            CPLVirtualMem* vmem = GDALDatasetGetVirtualMem( self,
            ^
    extensions/gdal_wrap.cpp:4237:31: error: use of undeclared identifier 'GDALDatasetGetVirtualMem'
            CPLVirtualMem* vmem = GDALDatasetGetVirtualMem( self,
                                  ^
    extensions/gdal_wrap.cpp:4263:237: error: unknown type name 'GDALTileOrganization'
    SWIGINTERN CPLVirtualMemShadow *GDALDatasetShadow_GetTiledVirtualMem(GDALDatasetShadow *self,GDALRWFlag eRWFlag,int nXOff,int nYOff,int nXSize,int nYSize,int nTileXSize,int nTileYSize,GDALDataType eBufType,int band_list,int *pband_list,GDALTileOrganization eTileOrganization,size_t nCacheSize,char **options=NULL){
                                                                                                                                                                                                                                                ^
    extensions/gdal_wrap.cpp:4266:9: error: unknown type name 'CPLVirtualMem'
            CPLVirtualMem* vmem = GDALDatasetGetTiledVirtualMem( self,
            ^
    extensions/gdal_wrap.cpp:4620:9: error: unknown type name 'CPLVirtualMem'
            CPLVirtualMem* vmem = GDALRasterBandGetVirtualMem( self,
            ^
    extensions/gdal_wrap.cpp:4620:31: error: use of undeclared identifier 'GDALRasterBandGetVirtualMem'
            CPLVirtualMem* vmem = GDALRasterBandGetVirtualMem( self,
                                  ^
    extensions/gdal_wrap.cpp:4647:9: error: unknown type name 'CPLVirtualMem'
            CPLVirtualMem* vmem = GDALGetVirtualMemAuto( self,
            ^
    extensions/gdal_wrap.cpp:4647:31: error: use of undeclared identifier 'GDALGetVirtualMemAuto'
            CPLVirtualMem* vmem = GDALGetVirtualMemAuto( self,
                                  ^
    extensions/gdal_wrap.cpp:4667:9: error: unknown type name 'CPLVirtualMem'
            CPLVirtualMem* vmem = GDALRasterBandGetTiledVirtualMem( self,
            ^
    extensions/gdal_wrap.cpp:4667:31: error: use of undeclared identifier 'GDALRasterBandGetTiledVirtualMem'; did you mean 'GDALRasterBandShadow_GetVirtualMem'?
            CPLVirtualMem* vmem = GDALRasterBandGetTiledVirtualMem( self,
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                  GDALRasterBandShadow_GetVirtualMem
    extensions/gdal_wrap.cpp:4619:33: note: 'GDALRasterBandShadow_GetVirtualMem' declared here
    SWIGINTERN CPLVirtualMemShadow *GDALRasterBandShadow_GetVirtualMem(GDALRasterBandShadow *self,GDALRWFlag eRWFlag,int nXOff,int nYOff,int nXSize,int nYSize,int nBufXSize,int nBufYSize,GDALDataType eBufType,size_t nCacheSize,size_t nPageSizeHint,char **options=NULL){
                                    ^
    extensions/gdal_wrap.cpp:4685:41: error: use of undeclared identifier 'GTO_BSQ'
            vmemshadow->eTileOrganization = GTO_BSQ;
                                            ^
    extensions/gdal_wrap.cpp:4867:16: error: use of undeclared identifier 'GDALRATChangesAreWrittenToFile'
            return GDALRATChangesAreWrittenToFile( self );
                   ^
    extensions/gdal_wrap.cpp:7845:31: warning: conversion from string literal to 'char *' is deprecated [-Wdeprecated-writable-strings]
            PyObject *item_list = PyMapping_Items( obj1 );
                                  ^
    /usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/include/python2.7/abstract.h:1354:50: note: expanded from macro 'PyMapping_Items'
    #define PyMapping_Items(O) PyObject_CallMethod(O,"items",NULL)
                                                     ^
    extensions/gdal_wrap.cpp:11385:21: warning: conversion from string literal to 'char *' is deprecated [-Wdeprecated-writable-strings]
          buf->format = "B";
                        ^
    extensions/gdal_wrap.cpp:11390:21: warning: conversion from string literal to 'char *' is deprecated [-Wdeprecated-writable-strings]
          buf->format = "h";
                        ^
    extensions/gdal_wrap.cpp:11395:21: warning: conversion from string literal to 'char *' is deprecated [-Wdeprecated-writable-strings]
          buf->format = "H";
                        ^
    extensions/gdal_wrap.cpp:11400:21: warning: conversion from string literal to 'char *' is deprecated [-Wdeprecated-writable-strings]
          buf->format = "i";
                        ^
    extensions/gdal_wrap.cpp:11405:21: warning: conversion from string literal to 'char *' is deprecated [-Wdeprecated-writable-strings]
          buf->format = "I";
                        ^
    extensions/gdal_wrap.cpp:11410:21: warning: conversion from string literal to 'char *' is deprecated [-Wdeprecated-writable-strings]
          buf->format = "f";
                        ^
    extensions/gdal_wrap.cpp:11415:21: warning: conversion from string literal to 'char *' is deprecated [-Wdeprecated-writable-strings]
          buf->format = "F";
                        ^
    extensions/gdal_wrap.cpp:11420:21: warning: conversion from string literal to 'char *' is deprecated [-Wdeprecated-writable-strings]
          buf->format = "B";
                        ^
    extensions/gdal_wrap.cpp:13656:3: error: unknown type name 'GDALTileOrganization'
      GDALTileOrganization arg12 ;
      ^
    extensions/gdal_wrap.cpp:13768:24: error: unknown type name 'GDALTileOrganization'
      arg12 = static_cast< GDALTileOrganization >(val12);
                           ^
    extensions/gdal_wrap.cpp:23687:14: warning: explicitly assigning a variable of type 'void *' to itself [-Wself-assign]
      clientdata = clientdata;
      ~~~~~~~~~~ ^ ~~~~~~~~~~
    13 warnings and 17 errors generated.
    error: command 'cc' failed with exit status 1
    Complete output from command /usr/local/opt/python/bin/python2.7 -c "import setuptools;__file__='/private/var/folders/y2/thsw8bnj0xz0vp55gcykptfw0000gn/T/pip_build_root/GDAL/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/y2/thsw8bnj0xz0vp55gcykptfw0000gn/T/pip-bLqvAE-record/install-record.txt --single-version-externally-managed:
    running install

running build

running build_py

creating build

creating build/lib.macosx-10.7-x86_64-2.7

copying gdal.py -> build/lib.macosx-10.7-x86_64-2.7

copying ogr.py -> build/lib.macosx-10.7-x86_64-2.7

copying osr.py -> build/lib.macosx-10.7-x86_64-2.7

copying gdalconst.py -> build/lib.macosx-10.7-x86_64-2.7

copying gdalnumeric.py -> build/lib.macosx-10.7-x86_64-2.7

creating build/lib.macosx-10.7-x86_64-2.7/osgeo

copying osgeo/__init__.py -> build/lib.macosx-10.7-x86_64-2.7/osgeo

copying osgeo/gdal.py -> build/lib.macosx-10.7-x86_64-2.7/osgeo

copying osgeo/gdal_array.py -> build/lib.macosx-10.7-x86_64-2.7/osgeo

copying osgeo/gdalconst.py -> build/lib.macosx-10.7-x86_64-2.7/osgeo

copying osgeo/gdalnumeric.py -> build/lib.macosx-10.7-x86_64-2.7/osgeo

copying osgeo/ogr.py -> build/lib.macosx-10.7-x86_64-2.7/osgeo

copying osgeo/osr.py -> build/lib.macosx-10.7-x86_64-2.7/osgeo

running build_ext

building 'osgeo._gdal' extension

creating build/temp.macosx-10.7-x86_64-2.7

creating build/temp.macosx-10.7-x86_64-2.7/extensions

cc -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I../../port -I../../gcore -I../../alg -I../../ogr/ -I/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/usr/local/lib/python2.7/site-packages/numpy/core/include -I/Library/Frameworks/GDAL.framework/Versions/1.9/include -c extensions/gdal_wrap.cpp -o build/temp.macosx-10.7-x86_64-2.7/extensions/gdal_wrap.o

extensions/gdal_wrap.cpp:2230:11: warning: explicitly assigning a variable of type 'int' to itself [-Wself-assign]

                    res = SWIG_AddCast(res);

                    ~~~ ^              ~~~

extensions/gdal_wrap.cpp:2233:11: warning: explicitly assigning a variable of type 'int' to itself [-Wself-assign]

                    res = SWIG_AddCast(res);

                    ~~~ ^              ~~~

extensions/gdal_wrap.cpp:3515:12: error: use of undeclared identifier 'GDALGetMetadataDomainList'

    return GDALGetMetadataDomainList( self );

           ^

extensions/gdal_wrap.cpp:3753:5: error: unknown type name 'CPLVirtualMem'

    CPLVirtualMem *vmem;

    ^

extensions/gdal_wrap.cpp:3761:5: error: unknown type name 'GDALTileOrganization'

    GDALTileOrganization eTileOrganization;

    ^

extensions/gdal_wrap.cpp:3836:15: warning: unused variable 'start_addr' [-Wunused-variable]

        char* start_addr = (char*)CPLVirtualMemGetAddr( self->vmem ) + start_offset;

              ^

extensions/gdal_wrap.cpp:4237:9: error: unknown type name 'CPLVirtualMem'

        CPLVirtualMem* vmem = GDALDatasetGetVirtualMem( self,

        ^

extensions/gdal_wrap.cpp:4237:31: error: use of undeclared identifier 'GDALDatasetGetVirtualMem'

        CPLVirtualMem* vmem = GDALDatasetGetVirtualMem( self,

                              ^

extensions/gdal_wrap.cpp:4263:237: error: unknown type name 'GDALTileOrganization'

SWIGINTERN CPLVirtualMemShadow *GDALDatasetShadow_GetTiledVirtualMem(GDALDatasetShadow *self,GDALRWFlag eRWFlag,int nXOff,int nYOff,int nXSize,int nYSize,int nTileXSize,int nTileYSize,GDALDataType eBufType,int band_list,int *pband_list,GDALTileOrganization eTileOrganization,size_t nCacheSize,char **options=NULL){

                                                                                                                                                                                                                                            ^

extensions/gdal_wrap.cpp:4266:9: error: unknown type name 'CPLVirtualMem'

        CPLVirtualMem* vmem = GDALDatasetGetTiledVirtualMem( self,

        ^

extensions/gdal_wrap.cpp:4620:9: error: unknown type name 'CPLVirtualMem'

        CPLVirtualMem* vmem = GDALRasterBandGetVirtualMem( self,

        ^

extensions/gdal_wrap.cpp:4620:31: error: use of undeclared identifier 'GDALRasterBandGetVirtualMem'

        CPLVirtualMem* vmem = GDALRasterBandGetVirtualMem( self,

                              ^

extensions/gdal_wrap.cpp:4647:9: error: unknown type name 'CPLVirtualMem'

        CPLVirtualMem* vmem = GDALGetVirtualMemAuto( self,

        ^

extensions/gdal_wrap.cpp:4647:31: error: use of undeclared identifier 'GDALGetVirtualMemAuto'

        CPLVirtualMem* vmem = GDALGetVirtualMemAuto( self,

                              ^

extensions/gdal_wrap.cpp:4667:9: error: unknown type name 'CPLVirtualMem'

        CPLVirtualMem* vmem = GDALRasterBandGetTiledVirtualMem( self,

        ^

extensions/gdal_wrap.cpp:4667:31: error: use of undeclared identifier 'GDALRasterBandGetTiledVirtualMem'; did you mean 'GDALRasterBandShadow_GetVirtualMem'?

        CPLVirtualMem* vmem = GDALRasterBandGetTiledVirtualMem( self,

                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

                              GDALRasterBandShadow_GetVirtualMem

extensions/gdal_wrap.cpp:4619:33: note: 'GDALRasterBandShadow_GetVirtualMem' declared here

SWIGINTERN CPLVirtualMemShadow *GDALRasterBandShadow_GetVirtualMem(GDALRasterBandShadow *self,GDALRWFlag eRWFlag,int nXOff,int nYOff,int nXSize,int nYSize,int nBufXSize,int nBufYSize,GDALDataType eBufType,size_t nCacheSize,size_t nPageSizeHint,char **options=NULL){

                                ^

extensions/gdal_wrap.cpp:4685:41: error: use of undeclared identifier 'GTO_BSQ'

        vmemshadow->eTileOrganization = GTO_BSQ;

                                        ^

extensions/gdal_wrap.cpp:4867:16: error: use of undeclared identifier 'GDALRATChangesAreWrittenToFile'

        return GDALRATChangesAreWrittenToFile( self );

               ^

extensions/gdal_wrap.cpp:7845:31: warning: conversion from string literal to 'char *' is deprecated [-Wdeprecated-writable-strings]

        PyObject *item_list = PyMapping_Items( obj1 );

                              ^

/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/include/python2.7/abstract.h:1354:50: note: expanded from macro 'PyMapping_Items'

#define PyMapping_Items(O) PyObject_CallMethod(O,"items",NULL)

                                                 ^

extensions/gdal_wrap.cpp:11385:21: warning: conversion from string literal to 'char *' is deprecated [-Wdeprecated-writable-strings]

      buf->format = "B";

                    ^

extensions/gdal_wrap.cpp:11390:21: warning: conversion from string literal to 'char *' is deprecated [-Wdeprecated-writable-strings]

      buf->format = "h";

                    ^

extensions/gdal_wrap.cpp:11395:21: warning: conversion from string literal to 'char *' is deprecated [-Wdeprecated-writable-strings]

      buf->format = "H";

                    ^

extensions/gdal_wrap.cpp:11400:21: warning: conversion from string literal to 'char *' is deprecated [-Wdeprecated-writable-strings]

      buf->format = "i";

                    ^

extensions/gdal_wrap.cpp:11405:21: warning: conversion from string literal to 'char *' is deprecated [-Wdeprecated-writable-strings]

      buf->format = "I";

                    ^

extensions/gdal_wrap.cpp:11410:21: warning: conversion from string literal to 'char *' is deprecated [-Wdeprecated-writable-strings]

      buf->format = "f";

                    ^

extensions/gdal_wrap.cpp:11415:21: warning: conversion from string literal to 'char *' is deprecated [-Wdeprecated-writable-strings]

      buf->format = "F";

                    ^

extensions/gdal_wrap.cpp:11420:21: warning: conversion from string literal to 'char *' is deprecated [-Wdeprecated-writable-strings]

      buf->format = "B";

                    ^

extensions/gdal_wrap.cpp:13656:3: error: unknown type name 'GDALTileOrganization'

  GDALTileOrganization arg12 ;

  ^

extensions/gdal_wrap.cpp:13768:24: error: unknown type name 'GDALTileOrganization'

  arg12 = static_cast< GDALTileOrganization >(val12);

                       ^

extensions/gdal_wrap.cpp:23687:14: warning: explicitly assigning a variable of type 'void *' to itself [-Wself-assign]

  clientdata = clientdata;

  ~~~~~~~~~~ ^ ~~~~~~~~~~

13 warnings and 17 errors generated.

error: command 'cc' failed with exit status 1

The main point being the last line: error: command 'cc' failed with exit status . 主要观点是最后一行:错误: command 'cc' failed with exit status I have tried virtually every fix I found on Stackoverflow and everywhere else, from the export CFLAG strategy to deleting files. 我已经尝试了几乎我在Stackoverflow和其他任何地方找到的修复,从导出CFLAG策略到删除文件。 I still get that error. 我仍然得到那个错误。

Can anyone help please. 任何人都可以帮忙。

I've just run into this (hence finding your question). 我刚刚碰到这个(因此找到了你的问题)。 I solved it by making sure that the version of (Python's) GDAL I was trying to install matched that of the libgdal on the system. 我通过确保我尝试安装的(Python) GDAL版本与系统上的libgdal相匹配来解决它。

In my case pip was pulling in GDAL==1.11.0 , whereas the version of libgdal I had was 1.10.1+dfsg-5ubuntu1 . 在我的情况下,pip拉入GDAL==1.11.0 ,而我的libgdal版本是1.10.1+dfsg-5ubuntu1 Running pip install GDAL==1.10.0 (maybe with the actual version substituted) should do the right thing. 运行pip install GDAL==1.10.0 (可能替换实际版本)应该做正确的事情。

Your compiler error is GDAL 1.11.0 expecting symbols that are only there in the most recent version of libgdal . 您的编译器错误是GDAL 1.11.0期望符号仅存在于最新版本的libgdal

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:命令&#39;cc&#39;失败,退出状态1 - MAC上的MySQLdb安装 - error: command 'cc' failed with exit status 1 - MySQLdb installation on MAC 在 Mac 上安装 pyfastext 时出错:命令“cc”失败,退出状态为 1 - Got error on installing pyfastext on Mac: command 'cc' failed with exit status 1 VerificationError:CompileError:命令“ cc”失败,退出状态为1 - VerificationError: CompileError: command 'cc' failed with exit status 1 GDAL 安装错误“错误:命令‘x86_64-linux-gnu-gcc’失败,退出状态为 1” - GDAL installation error "error: command 'x86_64-linux-gnu-gcc' failed with exit status 1" 无法使用pip安装折扣:错误:命令'cc'失败,退出状态为1 - Can't install discount with pip: error: command 'cc' failed with exit status 1 错误:命令“cc”在 Mac 上失败,退出状态为 1,用于 pip install MySQL-python - error: command 'cc' failed with exit status 1 on Mac for pip install MySQL-python 命令'cc'在OSX High Sierra上以退出状态1失败 - command 'cc' failed with exit status 1 on OSX High Sierra 安装python库时,“'cc'以退出状态1失败”错误 - “'cc' failed with exit status 1” error when install python library 运行easy_install PIL时,出现错误:安装脚本退出错误:命令&#39;cc&#39;失败,退出状态为1 - when running easy_install PIL, I got the error: Setup script exited with error: command 'cc' failed with exit status 1 错误命令&#39;gcc&#39;失败,退出状态为1 - Error command 'gcc' failed with exit status 1
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM