This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Dynamic Libraries under Solaris


On May  2, 2000, Vinu V Nair <vinu@sasi.com> wrote:

> g++ -o libname.so -shared source.o
>  where source.o is obtained as follows
> g++ -c source.cxx,

You're missing -fPIC.

> NB: This (both gcc and g++) works fine in Linux.

GNU ld isn't as strict WRT -fPIC as Solaris' linker.  But it's
advantageous to use it on GNU/Linux too, since it allows for sharing
of code pages.

-- 
Alexandre Oliva    Enjoy Guaranį, see http://www.ic.unicamp.br/~oliva/
Cygnus Solutions, a Red Hat company        aoliva@{redhat, cygnus}.com
Free Software Developer and Evangelist    CS PhD student at IC-Unicamp
oliva@{lsd.ic.unicamp.br, gnu.org}   Write to mailing lists, not to me


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]