From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19618 invoked by alias); 11 Feb 2002 16:24:12 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Received: (qmail 19488 invoked from network); 11 Feb 2002 16:24:11 -0000 Received: from unknown (HELO alageremail1.agere.com) (192.19.192.106) by sources.redhat.com with SMTP; 11 Feb 2002 16:24:11 -0000 Received: from rderelay.agere.com (rderelay.agere.com [135.15.172.48]) by alageremail1.agere.com (8.10.2+Sun/8.10.2) with ESMTP id g1BGMVG27243 for ; Mon, 11 Feb 2002 11:22:31 -0500 (EST) Received: from almail.agere.com by rderelay.agere.com (8.9.3+Sun/EMS-1.5 sol2) id LAA13399 for ; Mon, 11 Feb 2002 11:24:09 -0500 (EST) Received: from PAI820G1006951 by almail.agere.com (8.9.3+Sun/EMS-1.5 sol2) id LAA14475; Mon, 11 Feb 2002 11:24:08 -0500 (EST) From: "Gerald S. Williams" To: Subject: Re: "Best" way to build a DLL? Date: Mon, 11 Feb 2002 08:24:00 -0000 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 X-SW-Source: 2002-02/txt/msg00531.txt.bz2 Have I just been lucky, or is building and linking of DLLs now supported by GCC directly? It looks like Nousiainen [am.nousiainen@pp.inet.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@agere.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/