Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm Sender: cygwin-owner@sourceware.cygnus.com Delivered-To: mailing list cygwin@sourceware.cygnus.com Message-Id: <199903310224.UAA25643@modi.xraylith.wisc.edu> X-Authentication-Warning: modi.xraylith.wisc.edu: localhost.xraylith.wisc.edu [127.0.0.1] didn't use HELO protocol To: JSONCRAIG@aol.com cc: cygwin@sourceware.cygnus.com Subject: Re: Relocatable DLLs In-reply-to: Your message of "Tue, 30 Mar 1999 20:09:01 EST." <1ce25344.370175ad@aol.com> Date: Tue, 30 Mar 1999 20:24:32 -0600 From: Mumit Khan JSONCRAIG@aol.com writes: > I searched for this but couldn't find anything on it. > > When I try to link my dll that has a function that uses iostream (I'm linking > -lstdc++ with it) I get a bunch of undefined references like "undefined > refernece to isspace". I don't know what I'm doing wrong...heres the ld > command > > ld -s --base-file foo.base --dll -o foo.dll foo.o -lstdc++ -e _dllEntry@12 > > Can anyone help? First of all, I suggest looking at the README file and the examples that come with dllhelpers package. It would've answered your question right away. See http://www.xraylith.wisc.edu/~khan/software/gnu-win32/ for more info. If you insist on using "ld" to link, then you must know all the other libraries that are needed, as well as other options that language drivers, such as gcc and c++, pass on to ld. In this particular case, you're missing -lcygwin. I suggest you use c++ to do the job. To make your life easier, just use dllwrap and be done with it. $ dllwrap -o foo.dll --driver-name=c++ --entry _dllEntry@12 foo.o or, $ dllwrap -o foo.dll --entry _dllEntry@12 foo.o -lstdc++ Will build a relocatable DLL (ie., run all 5 passes) for you. Since you're not specifying a DEF file, I'm assuming that you've used dllexport attribute in all places necessary. For C++ code, you almost always have to use --export-all to export everything needed (some are due to bugs and misfeatures in GCC's dllexport attribute). $ dllwrap -o foo.dll --export-all --implib=libfoo.a \ --entry _dllEntry@12 foo.o -lstdc++ Regards, Mumit -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe@sourceware.cygnus.com