From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 46799 invoked by alias); 12 Jun 2015 21:01:36 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 46785 invoked by uid 89); 12 Jun 2015 21:01:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.7 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: ipnmail.in2p3.fr Received: from ipnmail.in2p3.fr (HELO ipnmail.in2p3.fr) (134.158.92.208) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 12 Jun 2015 21:01:35 +0000 Received: from [134.158.92.170] (ipninter2.in2p3.fr [134.158.92.170]) by ipnmail.in2p3.fr (Postfix) with ESMTPA id 538B02178 for ; Fri, 12 Jun 2015 23:01:33 +0200 (CEST) Message-ID: <557B48AD.5090504@ipno.in2p3.fr> Date: Fri, 12 Jun 2015 21:01:00 -0000 From: Laurent Tassan-Got User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: cygwin@cygwin.com Subject: Problem linking with an import library (.lib) file: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-06/txt/msg00244.txt.bz2 I got the same problem as Mark Rivers, already reported with the same subject. I'm running cygwin 32-bits version 2.0.3 under Windows 7 64 bits I got from a hardware manufacturer a DLL N957lib.dll and the associated import library N957lib.lib When I try to link a small test program with the command: gcc -Wall -DWIN32 -I. -o tst tst.c ./N957lib.lib I get the message: "N957lib.lib: error adding symbols: Format de fichier non reconnu" (File in wrong format) Now if I use the MingW compiler (either under cygwin or Msys): i686-pc-mingw32-gcc -Wall -DWIN32 -I. -o tst tst.c ./N957lib.lib everything is fine and the program (tst.exe) executes as expected, for example printing error messages issued by the library. But this doesn't help me because I need the full cygwin capabilities (X11, Lesstif) The cygwin gcc version is 4.9.2, while the MingW one is 4.7.3, so that it seems that there is a problem in decoding .lib libraries with the newest gcc versions. I tried to bypass the problem by re-building the .lib from the dll by using pexports and dlltool. I get a .lib with the right format, readable by gcc, but some references are still missing at the link stage. Any hint about the gcc (ld) decoding of .lib ? -- ************************************ * Laurent TASSAN-GOT * * IPN - Bat 102 * * Universite Paris-Sud * * 91406 ORSAY Cedex (France) * * tel : 33 1 69 15 72 55 * * fax : 33 1 69 15 45 07 * * email : tassango@ipno.in2p3.fr * ************************************ -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple