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: Building shared library that uses libstdc++


On Apr 13, 2001, "Lundell, Jens O." <JENS.O.LUNDELL@saic.com> wrote:

> g++ -fPIC -shared -o libjens.so source.cpp

> g++ -static -o jensexe source.cpp

> but when I combine the two I get the following error:

> ld: warning: option -d appears more than once, first setting taken

Do you mean, as in:

  g++ -fPIC -shared -static -o libjens.so source.cpp ?
            ^^^^^^^^^^^^^^^

This just can't work.

> Do I have to distribute libstdc++.so.2.10.0 together with my shared library?

Specify the full pathname of libstdc++.a, and use the -mimpure-text
switch, such that the linker won't complain even though libstc++.a
contains non-PIC.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* 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]