Re: [Dev-C++] errors when linking to a .lib
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Per W. <pw...@ia...> - 2004-04-15 08:26:06
|
Sorry, but that won't help. Converting a library from .lib to .a doesn't change the fact that the library contains references to the Visual C++ runtime library while GCC has it's own RTL. I don't think there is anything you can do to make use of this library with DevC++, less than to create a stub program using VC++ that reexports the functions. /Per W On Thu, 15 Apr 2004, Alexander Streit wrote: > Joshua, > > The reimp tool does exactly what you need. You get it as part of the > "MinGW Utilities". > Download it from here: > 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 a= m 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 weir= d MS things. The people that provide the lib also provided me with a MSVC w= orkspace/project, which I am able to use my friends copy of MSVC to compile= 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 gre= atly appreciated. > > > >Attached is a copy of the link output. > > > >Josh Stewart. > > > > > >------------------------------------------------------------------------ > > > >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 -luser3= 2 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lu= uid -lodbc32 -lodbccp32 --verbose lib/Sigmalib.lib Reading specs from C:/D= ev-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 --d= isable-nls --enable-languages=3Df77,c++,objc,ada --disable-win32-registry -= -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.2= /../../../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/Bi= n/../lib/gcc-lib/mingw32/3.2/../../../../mingw32/lib -LC:/Dev-Cpp/Bin/../li= b/gcc-lib/mingw32/3.2/../../.. JOSHspares1.o -lkernel32 -luser32 -lgdi32 -l= winspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32= -lodbccp32 lib/Sigmalib.lib -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt = -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lgcc -lmoldname -lmingw= ex -lmsvcrt C:/Dev-Cpp/Bin/../lib/gcc-lib/mingw32/3.2/crtend.o Info: resolv= ing __iob by linking to __imp___iob (auto-import) lib/Sigmalib.lib(./Debug/= Sigmalib.obj)(.debug$S+0x542):C:\Sig16dev\MISC\C: variable '_iob' can't be = auto-imported. Please read the documentation for 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 undefined= 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 > > > > > >------------------------------------------------------------------------ > > > >"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 y= ou are not the intended recipient. No rights of privacy, confidentiality, c= opyright or privilege are waived or lost by any mistransmission. If you rec= eive this email in error, please immediately delete it from your system, de= stroy all copies, and notify the sender. Emails may be interfered with, may= contain computer viruses or other defects, and may cause damage to your sy= stem. Raytheon gives no warranty in relation to the effect of this email on= your system, or the accuracy or completeness of its contents." > > > > > > -- > Alexander Streit > > PhD |