X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:references :in-reply-to:content-type:content-transfer-encoding :mime-version; q=dns; s=default; b=J2FcmC4SAr9AyR02vc0yGkhAIbGFr KerOE0pTpHJS52VS8OjdyETblED9516KYDuJRc2O98aUHzU5eotUly/3vxmY3E5E ShWGk7XjcZPCO15aL/JCcsrxWHVK5TQQ/QohVwBH1S/svJtqUCbEe565uDm2rRwY rrnCQzMRZ0lE00= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:references :in-reply-to:content-type:content-transfer-encoding :mime-version; s=default; bh=F4aVbLXxCyyATgQUf4o75XqryMk=; b=AWX JefIYwlcPWw4My/9xVjWBP12ODHHiRqQ2G3wyr7Yz5uer3XMN8nHi2ssOLl7t9bn 0KKw086uhzZjyfxmdfiG8T+EIdM63CuomRRw8MsilpEMpFsfoPCWvrXGLNST+raa LE4kCm0zlxbRCR5S3hbWX+kmIybMC6dw2C5Oyg3Q= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: Yes, score=6.9 required=5.0 tests=AWL,BAYES_99,BAYES_999,KAM_LAZY_DOMAIN_SECURITY,LOTS_OF_MONEY,MIME_BASE64_BLANKS autolearn=no version=3.3.2 X-HELO: carsmail2.cars.aps.anl.gov From: Mark Rivers To: "'cygwin AT cygwin DOT com'" Subject: RE: Problem linking with an import library (.lib) file: Date: Thu, 14 May 2015 14:47:25 +0000 Message-ID: <70AE7462E7AD054C89DCBA45343D499A65861B29@CARSMAIL2.CARS.APS.ANL.GOV> References: <70AE7462E7AD054C89DCBA45343D499A65860E12 AT CARSMAIL2 DOT CARS DOT APS DOT ANL DOT GOV> <70AE7462E7AD054C89DCBA45343D499A65860EBD AT CARSMAIL2 DOT CARS DOT APS DOT ANL DOT GOV> In-Reply-To: <70AE7462E7AD054C89DCBA45343D499A65860EBD@CARSMAIL2.CARS.APS.ANL.GOV> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id t4EEm28W017397 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 AT 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 AT cygwin DOT 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