02-18-04 07:34 AM
Pushkar Pradhan wrote:
>
> Hi,
> I'm having trouble with compiling some examples in an open source
> software. The Makefile is provided, following is the command and the error
:
> g++ image_open.o -L/rstc/user1/erc/pushkar/ossim/lib
> -L/rstc/user1/erc/pushkar/ossim/src/packages/gdal
> -L/usr/local/mpi/lib -L/rstc/user1/erc/pushkar/ossim/lib/.libs
> -lossim_init -lossim_plugin -lossim_visualsim -lossim_parallel
> -lossim_vec -lossim_imaging -lossim_projections -lossim_elevation
> -lossim_support_data -lossim_vec -lossim_vpfutil -lossim_font
> -lossim_base -lossim_polyclip -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
>
> You can see above the path to the gdal dir. is specified
> (...src/packages/gdal) but in order to link to the static lib. I forced
> it like this:
> -L/rstc/user1/erc/pushkar/ossim/src/packages/gdal/.libs/libgdal.a
Not correct - this switch tells the linker to look in the directoryt
named /rstc/user1/erc/pushkar/ossim/src/packages/gdal/.libs/libgdal.a
for a library files. Of course, there is no such directory.
If the libraries are indeed in
/rstc/user1/erc/pushkar/ossim/src/packages/gdal, then the above link
line looks correct. Perhaps the permissions are incorrect.
To ensure satatic library is used, check your compiler/linker options.
There should be something like "-static" or "-static_shared" available.
>
> Even then I get the same error. (Both libgdal.so and libgdal.a are in
> this .libs dir.) Can you tell what's wrong?
> Pushkar
--
Fred L. Kleinschmidt
Boeing Associate Technical Fellow
Technical Architect, Common User Interface Services
M/S 2R-94 (206)544-5225
[ Post a follow-up to this message ]
|