欢迎DaLao指导

博客名称

你的一句话介绍

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.

posted @ 2013-11-23 20:54  麻辣咸鱼  阅读(562)  评论(0编辑  收藏  举报