Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
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
Message-ID: <412EC747.5050601@luukku.com>
Date: Fri, 27 Aug 2004 08:31:51 +0300
From: Jani tiainen <redetin@luukku.com>
User-Agent: Mozilla Thunderbird 0.7.1 (Windows/20040626)
MIME-Version: 1.0
To: Yu-Cheng Chou <cycchou@ucdavis.edu>
CC: Cygwin List <cygwin@cygwin.com>
Subject: Re: convert .lib to .a
References: <200408270208.i7R28QMk005153@andrena.ucdavis.edu>
In-Reply-To: <200408270208.i7R28QMk005153@andrena.ucdavis.edu>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes

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.

To my knowledge it's not possible to do this with static libs.

-- 

Jani Tiainen




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

