Re: [Dev-C++] errors when linking to a .lib
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Alexander S. <a.s...@qu...> - 2004-04-15 06:58:53
|
Joshua, The reimp tool does exactly what you need. You get it as part of the=20 "MinGW Utilities". Download it from here:=20 http://prdownloads.sf.net/mingw/mingw-utils-0.3.tar.gz?download it will turn a XXX.lib to a libXXX.a file, ready to be used with Dev-Cpp.= Stewart, Joshua wrote: >I am trying to link a C program with a .lib library file that was provid= ed to me by a third party. >All I have is a .lib, header files and an example program with MSVC proj= ect files. I want to try and use DevC++ to link the sample provided but I= am having some trouble. > >When trying to use DevC++ to link I get the following errors. > >lib/Sigmalib.lib(./Debug/Sigmalib.obj)(.text+0xb1): In function `c_initf= iles': >c:\sig16dev\misc\c:20: undefined reference to `_chkesp' >fu000005.o(.idata$3+0xc): undefined reference to `libmsvcrt_a_iname' >nmth000000.o(.idata$4+0x0): undefined reference to `_nm___iob' > >I think this is because the lib was built in MS Visual C++ and there are= functions in the library (eg initfiles) that are making references to we= ird MS things. The people that provide the lib also provided me with a MS= VC workspace/project, which I am able to use my friends copy of MSVC to c= ompile and link without hassel. > >I tried to import the MSVC dsp file using the DevC++ import feature, but= that also failed to build, with the same errors. > >i read somewhere in the archives that i might need to use reimp to conve= rt the .lib to an .a file? >would this help? how would I do this? Could I then put in my own dummy c= opy of _chkesp and ar myself a new library? > >If anyone has seen this thing before when trying to port other MSVC libr= aries or trying to use third party libs maybe you can help. Or perhaps I = am missing a simple linker switch (I am new to DevC++). Any assistance is= greatly appreciated. > >Attached is a copy of the link output. > >Josh Stewart. > =20 > >------------------------------------------------------------------------= > >Compiler: Default compiler >Building Makefile: "C:\logistics\testbuild1\Makefile.win" >Executing make... >make.exe -f "C:\logistics\testbuild1\Makefile.win" all >gcc.exe -D__DEBUG__ JOSHspares1.o -o "Simu1testbuild.exe" -L"C:/Dev-Cpp= /lib" -L"C:/logistics/testbuild1/lib" -L"C:/Dev-Cpp/lib" -lkernel32 -luse= r32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32= -luuid -lodbc32 -lodbccp32 --verbose lib/Sigmalib.lib Reading specs fro= m C:/Dev-Cpp/Bin/../lib/gcc-lib/mingw32/3.2/specs >Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as= --host=3Dmingw32 --target=3Dmingw32 --prefix=3D/mingw --enable-threads -= -disable-nls --enable-languages=3Df77,c++,objc,ada --disable-win32-regist= ry --disable-shared >Thread model: win32 gcc version 3.2 (mingw special 20020817-1) > C:\Dev-Cpp\Bin\..\lib\gcc-lib\mingw32\3.2\..\..\..\..\mingw32\bin\ld.ex= e -Bdynamic -o Simu1testbuild.exe C:/Dev-Cpp/Bin/../lib/gcc-lib/mingw32/3= =2E2/../../../crt2.o C:/Dev-Cpp/Bin/../lib/gcc-lib/mingw32/3.2/crtbegin.o= -LC:/Dev-Cpp/lib -LC:/logistics/testbuild1/lib -LC:/Dev-Cpp/lib -LC:/Dev= -Cpp/Bin/../lib/gcc-lib/mingw32/3.2 -LC:/Dev-Cpp/Bin/../lib/gcc-lib -LC:/= Dev-Cpp/Bin/../lib/gcc-lib/mingw32/3.2/../../../../mingw32/lib -LC:/Dev-C= pp/Bin/../lib/gcc-lib/mingw32/3.2/../../.. JOSHspares1.o -lkernel32 -luse= r32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32= -luuid -lodbc32 -lodbccp32 lib/Sigmalib.lib -lmingw32 -lgcc -lmoldname -= lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lgc= c -lmoldname -lmingwex -lmsvcrt C:/Dev-Cpp/Bin/../lib/gcc-lib/mingw32/3.2= /crtend.o Info: resolving __iob by linking to __imp___iob (auto-import) l= ib/Sigmalib.lib(./Debug/Sigmalib.obj)(.debug$S+0x542):C:\Sig16dev\MISC\C:= variable '_iob' can't be auto-imported. Please read the documentation fo= r ld's --enable-auto-import for details. >lib/Sigmalib.lib(./Debug/Sigmalib.obj)(.text+0x427): In function `c_init= lk': >c:\sig16dev\misc\c:123: undefined reference to `_chkesp' >lib/Sigmalib.lib(./Debug/Sigmalib.obj)(.text+0xb1): In function `c_initf= iles': >c:\sig16dev\misc\c:20: undefined reference to `_chkesp' >lib/Sigmalib.lib(./Debug/Sigmalib.obj)(.text+0x213): In function `c_disk= _in': >c:\sig16dev\misc\c:75: undefined reference to `_chkesp' >lib/Sigmalib.lib(./Debug/Sigmalib.obj)(.text+0x66): In function `c_askme= ': >c:\sig16dev\misc\c:6: undefined reference to `_chkesp' >lib/Sigmalib.lib(./Debug/Sigmalib.obj)(.text+0x3e2): In function `c_file= ': >c:\sig16dev\misc\c:123: undefined reference to `_chkesp' lib/Sigmalib.li= b(./Debug/Sigmalib.obj)(.text+0x3dd):c:\sig16dev\misc\c:147: more undefin= ed references to `_chkesp' follow >fu000001.o(.idata$3+0xc): undefined reference to `libmsvcrt_a_iname' >fu000002.o(.idata$3+0xc): undefined reference to `libmsvcrt_a_iname' >fu000003.o(.idata$3+0xc): undefined reference to `libmsvcrt_a_iname' >fu000004.o(.idata$3+0xc): undefined reference to `libmsvcrt_a_iname' >fu000005.o(.idata$3+0xc): undefined reference to `libmsvcrt_a_iname' >nmth000000.o(.idata$4+0x0): undefined reference to `_nm___iob' make.exe:= *** [Simu1testbuild.exe] Error 1 Execution terminated > =20 > >------------------------------------------------------------------------= > >"This email (including all attachments) is for the use of the named addr= essee only. You must not use, disclose, or copy any part of this email if= you are not the intended recipient. No rights of privacy, confidentialit= y, copyright or privilege are waived or lost by any mistransmission. If y= ou receive this email in error, please immediately delete it from your sy= stem, destroy all copies, and notify the sender. Emails may be interfered= with, may contain computer viruses or other defects, and may cause damag= e to your system. Raytheon gives no warranty in relation to the effect of= this email on your system, or the accuracy or completeness of its conten= ts." =20 > =20 > --=20 Alexander Streit PhD Candidate Media R&D Group Centre for IT Innovation Queensland University of Technology |