Unix Programming - RE: make errors

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > February 2004 > RE: make errors





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author RE: make errors
Pushkar Pradhan

2004-02-17, 8:34 am

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

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

2004-02-18, 2: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
Sean Burke

2004-02-18, 4:34 am


"Fred L. Kleinschmidt" <fred.l.kleinschmidt@nospam_boeing.com> writes:
[color=blue]
> Pushkar Pradhan wrote:
>
> 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.

If the library really is in this .libs directory (what is the purpose
of that?) then the link option should be

-L/rstc/user1/erc/pushkar/ossim/src/packages/gdal/.libs

-SEan

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com