delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/04/18/10:40:14

X-Spam-Check-By: sourceware.org
From: "Dave Korn" <dave DOT korn AT artimi DOT com>
To: <cygwin AT cygwin DOT com>
References: <Pine DOT OSF DOT 4 DOT 21 DOT 0704171429110 DOT 2777-100000 AT ax0rm1 DOT roma1 DOT infn DOT it> <4624C9BF DOT 35C7B6E3 AT dessent DOT 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
X-Mailer: Microsoft Office Outlook 11
In-Reply-To: <4624C9BF.35C7B6E3@dessent.net>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019