X-Spam-Check-By: sourceware.org
From: "Dave Korn" <dave.korn@artimi.com>
To: <cygwin@cygwin.com>
References: <Pine.OSF.4.21.0704171429110.2777-100000@ax0rm1.roma1.infn.it> <4624C9BF.35C7B6E3@dessent.net>
Subject: RE: Transforming a static library to a DLL
Date: Tue, 17 Apr 2007 14:39:14 +0100
Message-ID: <022b01c780f5$c9bd7cd0$2e08a8c0@CAM.ARTIMI.COM>
MIME-Version: 1.0
Content-Type: text/plain; 	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook 11
In-Reply-To: <4624C9BF.35C7B6E3@dessent.net>
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On 17 April 2007 14:21, Brian Dessent wrote:

[ other issues aside, ... ]

>>    gcc -shared -o cygmathlib.dll \
>>        -Wl,--enable-auto-image-base \
>>        -Wl,--out-implib=libmathlib.dll.a \
>>        -Wl,--enable-auto-import
>>        -Wl,--whole-archive libmathlib.a \
>>        -Wl,--no-whole-archive -lg2c
>> 
>> but it fails with a lot of :
>> -------------------------------------
>> libmathlib.a(arithm.o):cccrN4fn.f:(.text+0x17): undefined reference to
>> `_funct_' libmathlib.a(arithm.o):cccrN4fn.f:(.text+0x154): undefined
>> reference to `_funct_' libmathlib.a(d501l1.o):cc44FCLd.f:(.text+0x2dd):
>> undefined reference to `_dvset_' ...
>> -------------------------------------
>> 
>> Perhaps I have forgot to add some other library on command line.
> 
> I don't know.  You'll have to use nm/ar to look around and see where
> these missing symbols are defined.  It could be a missing library, it
> could be a link order problem, or it could be that some preprocessor
> symbol was in the wrong state (i.e. defined when it shouldn't be or
> missing when it was required, ala -DFOO_STATIC or -DBUILDING_FOO or
> -DFOO_DLL etc.) when the objects were compiled which caused __declspec
> declarations to be wrong.  It all depends on the design of the library.

  It's almost inevitable, isn't it?  A static (.a) library can have undefined
external references, but on 'doze, a shared library (== a DLL) can't have any
- unlike a linux .so, which needn't be fully resolved until it's dynamically
loaded by ld.so at runtime.

    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

