Help!! Can you please tell me how to build a shared library...
Erik Mouw
J.A.K.Mouw@ITS.TUDelft.NL
Thu Dec 21 02:54:00 GMT 2000
On Wed, Dec 20, 2000 at 07:25:02PM -0500, Elizabeth Chan wrote:
> I've been trying to build a shared library using gcc on an hpux 10.20
> system.
> I have however been unsuccessfull. can you please shed some lights, I'm
> totally lost as to what I should do. Thanks a million.
>
> This is the error that I get when trying to build a dynamic library. The
> library that I'm trying to build is called libjcif.so.
>
> This is the error (I did the 2 lines of asterisks (****) down below to
> quote the error message)
>
> ****************************************************************************
> ***************************************
> /usr/ccs/bin/ld: DP relative code in file
> /opt/gcc/lib/gcc-lib/hppa1.1-hp-hpux10.20/2.95.2/libstdc++.a(cstrmain.o) -
> shared library must be position independent. Use +z or +Z to recompile.
> ****************************************************************************
> ***************************************
> The above error message is coming from the following command that I'm
> executing from a makefile,
> Building libjcif.so
> /usr/local/bin/gcc -shared -o ../build/hpux-hppa/debug/lib/libjcif.so
Yes, -shared usually works on Linux, but it is highly system dependent
(doesn't work on SGI IRIX 6.x, for example). I suggest to use GNU
libtool to create shared libraries for your platform. Libtool contains
the collective knowledge of many developers to manipulate libraries on
many platforms. See http://www.gnu.org/software/libtool/ .
Erik
--
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department
of Electrical Engineering, Faculty of Information Technology and Systems,
Delft University of Technology, PO BOX 5031, 2600 GA Delft, The Netherlands
Phone: +31-15-2783635 Fax: +31-15-2781843 Email: J.A.K.Mouw@its.tudelft.nl
WWW: http://www-ict.its.tudelft.nl/~erik/
More information about the Gcc
mailing list