[Freegis-list] Compile shapelib (shared) on Solaris
Eric Pyle
eric.pyle at na.teleatlas.com
Thu Jul 11 15:44:19 CEST 2002
Hi Jan,
I had already added the line "CC = gcc" to the Makefile. I tried the 'ld' command by hand as you
suggested (after the 'gmake lib' failed) and it executed without complaint. My path points me to
/usr/ccs/bin/ld.
I also got a suggestion from Chris Bell to make sure I had the version of libtool for Solaris, so
I downloaded and installed libtool 1.4 from sunfreeware.com. The errors were still the same.
However, it appears that the error message stems from the Makefile line:
/bin/sh libtool --mode=link gcc -g -O2 -o libshp.la -rpath /usr/local/lib \
-version-info 1:1:0 shpopen.lo shptree.lo dbfopen.lo
When I execute this line by hand I get the same error messages:
boston% /bin/sh libtool --mode=link gcc -g -O2 -o libshp.la -rpath /usr/local/lib -version-info
1:1:0 shpopen.lo shptree.lo dbfopen.lo
rm -fr .libs/libshp.la .libs/libshp.* .libs/libshp.*
gcc -shared shpopen.lo shptree.lo dbfopen.lo -lc -Wl,-soname -Wl,libshp.so.1 -o
.libs/libshp.so.1.0.1
ld: warning: option -o appears more than once, first setting taken
ld: fatal: file libshp.so.1: cannot open file: No such file or directory
ld: fatal: File processing errors. No output written to .libs/libshp.so.1.0.1
collect2: ld returned 1 exit status
So libtool apparently performs the 'rm', and calls gcc with the -shared flag and flags telling the
linker to make the shared object libshp.so.1, and a final output file from gcc of
.libs/libshp.so.1.0.1. I assume that 'ld' is being called by gcc. Unfortunately I can't seem to
find a way to see exactly what is being passed to ld. Giving gcc the -v flag showed me the syntax
of collect2, which apparently calls ld, but still no clues.
Any other ideas?
Thanks,
Eric
Jan-Oliver Wagner wrote:
> Hi Eric,
>
> On Wed, Jul 03, 2002 at 12:32:48PM -0400, Eric Pyle wrote:
> > I'm trying to compile shapelib 1.2.9 as a shared library on a Solaris
> > system and am getting an error. I use the command "gmake lib". I can
> > "gmake" with no problem, but I understand I need to make the shared
> > version to use with gen2shp. Alternatively, I would be happy to modify
> > gen2shp to link statically if someone can point the way. Thanks!
>
> I tried on:
>
> | cheops shapelib-1.2.9 64: uname -a
> | SunOS cheops 5.8 Generic_108528-13 sun4u sparc SUNW,Ultra-1
>
> and no serious problem occured.
> You should make sure to use the CC=gcc and the correct ld.
> For the latter you might try to manually execute:
>
> | ld -G -h libshp.so.1 -o .libs/libshp.so.1.0.1 shpopen.lo shptree.lo dbfopen.lo -lc
>
> instead of using the makefile-executed version:
>
> | /usr/bin/ld -G -h libshp.so.1 -o .libs/libshp.so.1.0.1 shpopen.lo shptree.lo dbfopen.lo -lc
--
Eric Pyle | Test Engineer | Tele Atlas North America, Inc.
A Unit of Tele Atlas NV | 31 Old Etna Rd. | Lebanon, NH 03766
(603) 448-0001 x23
eric.pyle at na.teleatlas.com
More information about the Freegis-list
mailing list
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)