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

Mark Rivers rivers@cars.uchicago.edu
Wed May 13 23:38:00 GMT 2015


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


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



More information about the Cygwin mailing list