zoukankan      html  css  js  c++  java
  • Install GDAL in OpenSUSE 12.3 Linux

    Runtime Enviroment:Open SUSE Linux *i385

    Notice:if any command disavliable ,you can copy the parameters in to the terminal then press enter to continue your configure.

    1、 Download the package :GDAL-1.9.2.tar.zg and PROJ-4.7.0.tar.zg in the following URL:

    URL: http://download.osgeo.org/gdal/

    URL: http://download.osgeo.org/proj/

    2、 安装GDAL-1.9.2库,命令如下:

    % cd gdal

    % ./configure

    % make

    % su

    Password: ********

    % make install

    % exit

    安装成功后,会在/usr/local/include文件夹中产生一系列.h文件(cpl_config.h、gdal.h……),在/usr/local/lib文件夹中产生5个库文件,其中libgdal.a和libgdal.la为静态链接库,libgdal.so, libgdal.so.1, libgdal.so.1.13.2为动态链接库。

    3、 安装PROJ-4.7.0库,命令如下:

    % cd proj

    % ./configure

    % make

    % su

    Password: ********

    % make install

    % exit

    安装成功后,会在/usr/local/include文件夹中产生4个.h文件(nad_list.h,

    org_proj4_Projections.h,proj_api.h,projects.h),在/usr/local/lib文件夹中产生5个库文件,其中libproj.a和libproj.la为静态链接库,libproj.so, libproj.so.0, libproj.so.0.6.6为动态链接库。

    4、 将/usr/local/lib添加到环境变量中,命令如下:

    cd /etc/ld.so.conf.d

    touch local.conf

    vi local.conf

    i

    /usr/local/lib

    Esc

    Wq

    Ldconfig -v

    5、 将/usr/local/include文件夹copy到当前工程(test)目录下。

    6、 test.cpp里面加载必要的头文件就可以使用GDAL和PROJ里面的函数:

    #include "./include/gdal.h"

    #include "./include/gdal_alg.h"

    #include "./include/cpl_conv.h"

    #include "./include/cpl_port.h"

    #include "./include/cpl_multiproc.h"

    #include "./include/ogr_srs_api.h"

    #include "./include/proj_api.h"

    7、 input the following command line to debug test.cpp:

    g++ test.cpp –lgdal –lproj –o TEST

    ./TEST

    8、The end.

  • 相关阅读:
    uva11059
    uva725
    程序中double类型的数输出为什么要用lf
    c++形参和实参同名时,如何单步执行观察形参的变化。
    台式机的字母键和数字键都不能正常使用了呢?
    找错误——下面的程序意图在于统计字符串中字符数1的个数,可惜有瑕疵
    初学者常见错误1——赋值时的类型转换
    scanf
    c++的调试与运行
    黑猫派对
  • 原文地址:https://www.cnblogs.com/AmatVictorialCuram/p/3439419.html
Copyright © 2011-2022 走看看