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

  • 相关阅读:
    算法
    什么叫「人的格局」?是否有必要培养大的格局或怎么培养?
    套接字
    信号量 P V测试详解
    Emacs快速入门
    Emacs 从入门到精通
    Linux多进程之间的文件锁
    mysql 登录报错:ERROR 1045 (28000)
    类职责协作模型
    .Netcore使用Session
  • 原文地址:https://www.cnblogs.com/AmatVictorialCuram/p/3439419.html
Copyright © 2020-2023  润新知