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]

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


Additional information:

- This is Cygwin 2.0.1, 32-bit on a Windows 7 64-bit machine.

The "file" utility claims it is an archive file:
$ file ../../lib/cygwin-x86/PlxApi.lib
../../lib/cygwin-x86/PlxApi.lib: current ar archive

The "nm" utility appears to interpret the file OK:

rivers@rivers-mobile2 /corvette/home/epics/devel/dxp/dxpApp/handelSrc
$ nm ../../lib/cygwin-x86/PlxApi.lib

PlxApi631.dll:
00000000 i .idata$2
00000000 i .idata$4
00000000 i .idata$5
00000000 i .idata$6
000420ff a @comp.id
00000000 I __IMPORT_DESCRIPTOR_PlxApi631
         U __NULL_IMPORT_DESCRIPTOR
         U âPlxApi631_NULL_THUNK_DATA

PlxApi631.dll:
000420ff a @comp.id
00000000 I __NULL_IMPORT_DESCRIPTOR

PlxApi631.dll:
000420ff a @comp.id
00000000 I âPlxApi631_NULL_THUNK_DATA

...

PlxApi631.dll:
00000000 I .idata$4
00000000 I .idata$5
00000000 I .idata$6
00000000 T .text
00000000 I __imp__PlxPci_VpdRead
         U __IMPORT_DESCRIPTOR_PlxApi631
00000000 T _PlxPci_VpdRead

PlxApi631.dll:
00000000 I .idata$4
00000000 I .idata$5
00000000 I .idata$6
00000000 T .text
00000000 I __imp__PlxPci_VpdWrite
         U __IMPORT_DESCRIPTOR_PlxApi631
00000000 T _PlxPci_VpdWrite

-----Original Message-----
From: Mark Rivers 
Sent: Wednesday, May 13, 2015 5:41 PM
To: 'cygwin@cygwin.com'
Subject: Problem linking with an import library (.lib) file: 

Folks,

I am having trouble linking with a normal Windows import library file when creating a DLL on Cygwin. These same import libraries worked fine when creating static Cygwin executables with older versions of Cygwin.

The error is: âerror adding symbols: File in wrong formatâ.

This is an example of the error (I have reformatted the long g++ command onto multiple lines to make it more legible):

$ make
make -C O.cygwin-x86 -f ../Makefile TOP=../../.. \
ÂÂÂ T_A=cygwin-x86 install
make[1]: Entering directory '/cygdrive/j/epics/devel/dxp/dxpApp/handelSrc/O.cygwin-x86'
g++ -o handel.dll -shared -Wl,--out-implib,handel.lib -L/cygdrive/j/epics/devel/dxp/lib/cygwin-x86 
    -L/cygdrive/h/epics/base-3.14.12.5/lib/cygwin-x86ÂÂÂÂÂÂÂ -m32ÂÂÂÂÂÂÂÂÂÂÂÂÂÂ
    xerxes.o xerxes_log.o md_log.o handel.o fdd.o psl.o handel_dbg.o handel_detchan.o handel_dyn_default.o 
    handel_dyn_detector.o handel_dyn_firmware.o handel_dyn_module.o handel_file.o handel_log.o handel_memdbg_win32.o 
    handel_run_control.o handel_run_params.o handel_sort.o handel_system.o handel_xerxes.o xia_assert.o xia_file.o 
    xia_mem.o xia_mem_point.o saturn.o saturn_psl.o xmap.o xmap_psl.o mercury.o mercury_psl.o xia_epp.o xia_plx.o 
    xia_usb.o xia_usb2.o md_win32.oÂÂÂ 
    -lrecIoc -lsoftDevIoc -lmiscIoc -lrsrvIoc -ldbtoolsIoc -lasIoc -ldbIoc -lregistryIoc  -ldbStaticIoc -lca -lCom -lDLPORTIO -lPlxApi -lsetupapi -lUser32 -lpthread -lm
/cygdrive/j/epics/devel/dxp/lib/cygwin-x86/PlxApi.lib: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
/corvette/usr/local/epics/base-3.14.12.5/configure/RULES_BUILD:300: recipe for target 'handel.dll' failed
make[1]: *** [handel.dll] Error 1
make[1]: Leaving directory '/cygdrive/j/epics/devel/dxp/dxpApp/handelSrc/O.cygwin-x86'
/corvette/usr/local/epics/base-3.14.12.5/configure/RULES_ARCHS:64: recipe for target 'install.cygwin-x86' failed
make: *** [install.cygwin-x86] Error 2

So it is complaining that the library PlxApi.lib is not in the correct format. However, this is definitely a valid Windows import library file.

Thanks,
Mark Rivers


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