progress on libstdc++.dll

Danny Smith dannysmith@clear.net.nz
Thu Jan 30 01:38:00 GMT 2003


Paul Kienzle  wrote
> I have been advised from a couple of sources that the dlltool approach
to
> building libstdc++.dll will not work.  So I then tried the following:
>
>


gcc -shared -Wl,-whole-archive,--export-all-symbols,--enable-auto-image-
base \
>  /usr/lib/libstdc++.a -Wl,-no-whole-archive -o libstdc++.dll
>
>   gcc -o
str.exe -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc str.o \
>  libstdc++.dll
>
> but the linker complained about many missing symbols.  Using nm, they
seem
> to be in libstdc++.dll.  Any suggestions what I'm doing wrong?
>

The advice was not completly correck:(

If using g++ -shared to build libstdc++.dll, you need to explode the
static archive into component modules and build the dll from them.  The
reason:  libstdc++.a is a system lib that is ignored when using
(implicitly or explicitly) --export-all

Also the  reason to use g++ -shared rather than dlltool is if you want
to use an import lib rather than direct linking against dll  You will
have to tell the linker that you want an import lib,
with -Wl,--out-implib,libstdc++.dll.a.  The import lib produced by
dlltool does not have auto-import symbols. The import lib produced by
gcc -shared does.  The "implied" import lib generated on-the-fly when
linking directly against the dll is like the one produced by
gcc -shared.

Danny

> Thanks in advance,
>
> Paul Kienzle
> pkienzle@nist.gov
>
>


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list