RE: [Dev-C++] errors when linking to a .lib
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Stewart, J. <JSt...@ra...> - 2004-04-15 08:29:14
|
I did this just then, firstly I: reimp Sigmalib.lib .. which outputted 3 .obj files and 1 .dll=20 Then I ran ar rcs libsigma.a *.obj *.dll .. to create the .a file (as per the = reimp README instructions) however i still get the same problems. am I missing a step here? Now I am linking with the following 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 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 = -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 --verbose lib/libsigma.a =20 Reading specs from 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-registry --disable-shared -Josh -----Original Message----- From: Alexander Streit [mailto:a.s...@qu...] Sent: Thursday, 15 April 2004 14:58 To: Stewart, Joshua Cc: dev...@li... Subject: Re: [Dev-C++] errors when linking to a .lib 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 = provided to me by a third party. >All I have is a .lib, header files and an example program with MSVC = project 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_initfiles': >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 weird MS things. The people that provide the lib also provided me = with a MSVC workspace/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 = convert the .lib to an .a file? >would this help? how would I do this? Could I then put in my own dummy = copy of _chkesp and ar myself a new library? > >If anyone has seen this thing before when trying to port other MSVC = libraries 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. > |