public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Problem linking with an import library (.lib) file:
@ 2015-06-12 21:01 Laurent Tassan-Got
  0 siblings, 0 replies; 6+ messages in thread
From: Laurent Tassan-Got @ 2015-06-12 21:01 UTC (permalink / raw)
  To: cygwin


    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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-06-12 21:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <70AE7462E7AD054C89DCBA45343D499A65860E12@CARSMAIL2.CARS.APS.ANL.GOV>
2015-05-13 23:38 ` Problem linking with an import library (.lib) file: Mark Rivers
2015-05-14 15:43   ` Mark Rivers
2015-05-15  0:47     ` JonY
2015-05-15 20:50     ` Mark Rivers
2015-05-16  4:58       ` JonY
2015-06-12 21:01 Laurent Tassan-Got

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).