工程目录paraRasterIO,里面 只有一个main.cpp,使用到gdal库
#include <iostream>
#include "gdal_priv.h"
#include "cpl_conv.h"
. 在paraRasterIO目录下:
1. 运行autoscan, 生成configure.scan,将内容修改如下:
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.68])
AC_INIT(paraRasterIO, 1.0, www.lreis.ac.cn)
AM_INIT_AUTOMAKE(paraRasterIO, 1.0)
AC_CONFIG_SRCDIR(main.cpp)
AC_CONFIG_HEADERS([config.h])
# Checks for programs.
AC_PROG_CXX
AC_PROG_LIBTOOL
# Checks for libraries.
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_CONFIG_FILES(Makefile)
AC_OUTPUT
改好以后把文件名改为configure.in
2. 生成Makefile.am
bin_PROGRAMS = paraRasterIO
paraRasterIO_SOURCES = main.cpp
paraRasterIO_LDADD =/usr/local/lib/libgdal.so
paraRasterIO_CPPFLAG =-lgdal
INCLUDES = -I/usr/local/include
3. aclocal
4. autoheader
5. autoconf
6.在paraRasterIO 下生成运行libtoolize, 生成ltmain.sh
7. touch NEWS README AUTHORS ChangeLog
8. cp -f /usr/share/automake-1.10/depcomp /usr/share/automake-1.10/compile .这个应该不是必须的
9. automake --add-missing
到这步如果没错误的话,应该可以执行传统GNU软件到编译安装过程了。
./configure
make
make install
make clean