delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/08/27/12:26:34

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
Reply-To: Cygwin List <cygwin AT cygwin DOT com>
Message-Id: <6.1.0.6.0.20040827122107.0389f358@pop.prospeed.net>
X-Sender:
Date: Fri, 27 Aug 2004 12:25:51 -0400
To: Jani tiainen <redetin AT luukku DOT com>, Yu-Cheng Chou <cycchou AT ucdavis DOT edu>
From: Larry Hall <lh-no-personal-replies-please AT cygwin DOT com>
Subject: Re: convert .lib to .a
Cc: Cygwin List <cygwin AT cygwin DOT com>
In-Reply-To: <412EC747.5050601@luukku.com>
References: <200408270208 DOT i7R28QMk005153 AT andrena DOT ucdavis DOT edu> <412EC747 DOT 5050601 AT luukku DOT com>
Mime-Version: 1.0

At 01:31 AM 8/27/2004, you wrote:
>Yu-Cheng Chou wrote:
>
>>Hi, Larry:
>>I have two c-callable static libs which are created by vc, but the source codes are not available.
>>I need these libs to create a shared library using gcc under cygwin.
>>Command line:
>>gcc -shared -o libmpi.dl mpi_chdl.o ../../src/lib/libmpi.a ../../src/lib/liblam.a ../../src/lib/chsd
>>k.lib ../../src/lib/ch.lib
>>Error message:
>>Warning: .drectve '/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" /EXPORT:___b
>>uiltin_Ch_VaArg ' unrecognized
>>Cannot export .idata$4: symbol not found
>>Cannot export .idata$5: symbol not found
>>Cannot export .idata$6: symbol not found
>>Cannot export .text: symbol not found
>>Cannot export &#8962;ch_NULL_THUNK_DATA: symbol not found
>>collect2: ld returned 1 exit status
>>make: *** [libmpi.dl] Error 1
>>Have any idea to fix this problem?
>
>AFAIK, you can't do that in that way.
>
>First, you have to build shared library (DLL in terms of Windoze), with VC. Then you can export API calls to .def and create .a from there on. Well of course you can generate .def from VC compilation and then generate .a lib. But this applies only to shared libs.


You can do this too with gcc if you extract the objects from the lib.  
Since Yu-Cheng mentioned that the source for these libs isn't available, 
there's not an obvious advantage to converting the static lib to a DLL 
with VC, unless it's available and one is more comfortable with 
it than gcc.  YMMV. ;-)


--
Larry Hall                              http://www.rfk.com
RFK Partners, Inc.                      (508) 893-9779 - RFK Office
838 Washington Street                   (508) 893-9889 - FAX
Holliston, MA 01746                     


--
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