代码之家  ›  专栏  ›  技术社区  ›  Samir Tendulkar

使用Ubuntu 18.04为GeoDjango安装GDAL时出现:**[port target]错误2

  •  0
  • Samir Tendulkar  · 技术社区  · 7 年前

    我正在尝试安装 GeoDjango 在我的项目中使用。我在用 Ubuntu 18.04 通过 VirtualBox . 我也在使用 吉德扬戈 安装指南 install Gdal . 我有 GEOS PROJ.4 已安装。

    我已成功运行以下命令:

    $ wget http://download.osgeo.org/gdal/1.11.2/gdal-1.11.2.tar.gz #success
    $ tar xzf gdal-1.11.2.tar.gz #success
    $ cd gdal-1.11.2 #success
    

    稍后我应该做以下工作(根据文档):

    $ ./configure
    $ make # Go get some coffee, this takes a while.
    $ sudo make install
    $ cd ..
    

    但是,当我运行这些行时:

    $ ./configure  #success
    $ make # Go get some coffee, this takes a while. #ERROR SEE BELOW
    

    我得到以下错误:

    samir@samir-VirtualBox:~/gdal-1.11.2$ make # Go get some coffee, this takes a while.
      (cd port; make)
      make[1]: Entering directory '/home/samir/gdal-1.11.2/port'
      /bin/bash /home/samir/gdal-1.11.2/libtool --mode=compile --tag=CXX g++ -std=c++98 -g -O2 -DHAVE_SSE_AT_COMPILE_TIME  -Wall  -DOGR_ENABLED -I/home/samir/gdal-1.11.2/port   -I../frmts/zlib  -DHAVE_LIBZ -c -o cpl_error.lo cpl_error.cpp
      libtool: compile:  g++ -std=c++98 -g -O2 -DHAVE_SSE_AT_COMPILE_TIME -Wall -DOGR_ENABLED -I/home/samir/gdal-1.11.2/port -I../frmts/zlib -DHAVE_LIBZ -c cpl_error.cpp  -fPIC -DPIC -o .libs/cpl_error.o
      cpl_error.cpp: In function 'void CPLErrorV(CPLErr, int, const char*, __va_list_tag*)':
      cpl_error.cpp:190:20: error: incompatible types in assignment of '__va_list_tag*' to 'va_list {aka __va_list_tag [1]}'
             wrk_args = args;
                        ^~~~
      cpl_error.cpp:226:24: error: incompatible types in assignment of '__va_list_tag*' to 'va_list {aka __va_list_tag [1]}'
                 wrk_args = args;
                            ^~~~
      ../GDALmake.opt:568: recipe for target 'cpl_error.lo' failed
      make[1]: *** [cpl_error.lo] Error 1
      make[1]: Leaving directory '/home/samir/gdal-1.11.2/port'
      GNUmakefile:53: recipe for target 'port-target' failed
      make: *** [port-target] Error 2
    

    下面是错误的截图。所以你可以看到它的颜色

    enter image description here

    如何解决此错误?

    1 回复  |  直到 7 年前
        1
  •  0
  •   Samir Tendulkar    7 年前

    请确保您的计算机上安装了ubuntu。如果你 正在使用windows,安装VirtualBox并下载Ubuntu(它是一个Linux 操作系统)。你可能需要在YouTube上学习Ubuntu的基础课程 或者是尤迪

    sudo apt install geos
    sudo apt install proj4
    sudo apt install gdal
    sudo-apt install postgressql
    sudo-apt install till postgis
    

    就这样。。你就这么简单。。

    then download pgadmin3 (pgadmin4在ubuntu上的 发表此评论的时间)

    make the database on pgadmin3 (its way simpler than psql)
    

    在你的虚拟环境中

    pip install dj-database-url
    pip install psycopg2
    pip install pillow
    

    我花了两个星期才弄明白。。希望你不用 在Windows上尝试这个几乎是不可能的。别跟着 GeoDjango用于安装带有品牌和 安装起来很困难。