Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Wed, 29 Jan 2003 22:54:00 +0000 From: Danny Smith Subject: Re: progress on libstdc++.dll To: Cygwin Cc: Paul Kienzle Reply-to: Danny Smith Message-id: <001701c2c7e9$51733f90$f790a7cb@DANNY> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7bit X-Priority: 3 X-MSMail-priority: Normal 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 AT nist DOT 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/