[Gdal-dev] RE: Gdal in ossim environment

Alessandro Amici alexamici at fastwebnet.it
Wed Feb 18 03:41:08 EST 2004


hi,

On Tuesday 17 February 2004 21:44, Pushkar Pradhan wrote:
> I'm trying to build the examples in ossim, but it can't link to the gdal
> libs.
> Since everything was built static, there is only a libgdal.la inside the
> gdal dir.
> I've compiled ossim to build static apps only (it's a long story...). Their
> (ossim's default) apps/odules/routines compiled fine. But this doesn't
> work: g++
> image_open.o -L/rstc/user1/erc/pushkar/ossim/lib
> -L/rstc/user1/erc/pushkar/o ssim/src/packages/gdal    -L/usr/local/mpi/lib 
> -L/rstc/user1/erc/pushkar/os sim/lib/.libs -lossim_init -lossim_plugin
> -lossim_visualsim -lossim_parallel -lossim_vec -lossim_imaging
> -lossim_projections -lossim_elevation -lossim_s upport_data -lossim_vec
> -lossim_vpfutil -lossim_font -lossim_base -lossim_po lyclip -lossim_matrix 
>  -lmpich -lpmpich -L/usr/lib -lfreetype     -lgdal -ljpeg -lgif -lpng -lz
> -lm -ldl -lutil   -o image_open
> /usr/local/gnu/bin/ld: cannot find -lgdal
> collect2: ld returned 1 exit status
> make: *** [image_open] Error 1
>
> It's getting the path to the gdal dir. but I think it's looking for
> libgdal-1.1.9.so.
> Can someone tell how I can pass the gdal lib. to my program? Thanks,
> Pushkar

as far as i understand /rstc/user1/erc/pushkar/ossim/src/packages/gdal is the 
build directory, not the installation one.
if so you have two alternatives:

good one, install gdal using ./configure --prefix=/my/inst/dir and then add 
-I/my/inst/dir/include -L/my/inst/dir/lib to the compile and link flags 
respectively.

hackish one, in order to find libgdal.a hidden by libtool you should add 
the .libs subdirectory to the library search path: 
-L/rstc/user1/erc/pushkar/ossim/src/packages/gdal/.libs
this is might be less portable, thou.

cheers,
alessandro



More information about the Gdal-dev mailing list