Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT 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 AT aol DOT com cc: cygwin AT sourceware DOT cygnus DOT com Subject: Re: Relocatable DLLs In-reply-to: Your message of "Tue, 30 Mar 1999 20:09:01 EST." <1ce25344 DOT 370175ad AT aol DOT com> Date: Tue, 30 Mar 1999 20:24:32 -0600 From: Mumit Khan JSONCRAIG AT aol DOT 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 AT 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 AT 12 foo.o or, $ dllwrap -o foo.dll --entry _dllEntry AT 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 AT 12 foo.o -lstdc++ Regards, Mumit -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com