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 Delivered-To: mailing list cygwin AT cygwin DOT com From: "Gerald S. Williams" To: Subject: Re: "Best" way to build a DLL? Date: Mon, 11 Feb 2002 11:24:06 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 Importance: Normal Have I just been lucky, or is building and linking of DLLs now supported by GCC directly? It looks like Nousiainen [am DOT nousiainen AT pp DOT inet DOT fi] has had the same experience, although Chuck Wilson's reply (and the FAQs, etc.) seem to indicate that you need to use libtool, rebase, and/or other tools. I seem to be getting along fine like this, though: gcc -o bin/my.dll -shared obj/my.o gcc -o bin/my.exe obj/main.o bin/my.dll I verified that this uses the library dynamically--the DLL is required at runtime. In fact, this is much nicer since I don't have to worry about those pesky .def files. And for some libraries, I avoid warnings that way. For example, when I link with libpython2.2.dll.a, I get warnings such as: Warning: resolving __Py_NoneStruct by linking to \ __imp___Py_NoneStruct (auto-import) Warning: resolving _PyInt_Type by linking to \ __imp__PyInt_Type (auto-import) I don't get these when linking to the dll directly. It sounds like some entries are missing in whatever .def file is used to build that import library, but that is just a guess. I don't mind using tools where needed (e.g., if I want to prevent some non-static symbols from being exported), but I'd rather not use extra tools if I don't need them, especially since some of the tools don't seem to be in the normal Cygwin distributions. So for now my makefiles just use GCC. This has been working so far for me, but as I said it could just be luck. Do I need to bite the bullet and figure out how to make a DLL another way? -Jerry -O Gerald S. Williams, 22Y-103GA : mailto:gsw AT agere DOT com O- -O AGERE SYSTEMS, 555 UNION BLVD : office:610-712-8661 O- -O ALLENTOWN, PA, USA 18109-3286 : mobile:908-672-7592 O- -- 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/