This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Problem linking with an import library (.lib) file:



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]