User forums > Using Code::Blocks

How to include an external lib and dll ???

<< < (2/2)

MortenMacFly:

--- Quote from: kerstin on September 08, 2008, 09:46:17 am ----lIEICAN02 C:\Kerstin\Code_Block\ta_project_test\IEICAN02.dll C:\Kerstin\Code_Block\ta_project_test\IEICAN02.lib

--- End quote ---
You seem not to understand what I was trying to tell you, so I "translate" what you tell the linker with this command line:

1.) link against the import library IEICAN02(.lib) (correct)
2.) link against the object file IEICAN02.dll --> wrong in two ways: a) this is not an object file b) you don't need to link against this DLL at all as you have an import library.
3.) link against the object file IEICAN02.lib --> wrong in two ways: a) this is not an object file b) you don't need to link against this library again. You did this already with 1.)

Honestly: Do what I told you, read the compiler's manual. You will get stuck over and over again. I am telling you! I was right in the last post -> you got stuck again because you did not listen to me. I won't tell again.

kerstin:
Sorry but I have to annoy you again. I tried to read some stuff up know, but it didn't really help.

I followed your steps again, and hopefully I have know what you suggested, but I still get the same error:

mingw32-g++.exe  -o bin\Debug\ta_project_test.exe obj\Debug\AbrechnungStatMenu.o obj\Debug\AdminMenu.o obj\Debug\BMP.o obj\Debug\BasisDialog.o obj\Debug\CAN.o obj\Debug\CCANDaten.o obj\Debug\CDaten.o obj\Debug\CDebug.o obj\Debug\CSVDatei.o obj\Debug\CTADaten.o obj\Debug\CThread.o obj\Debug\CZustand.o obj\Debug\CZustandBMWApp.o obj\Debug\CZustandInit.o obj\Debug\CZustandTAApp.o obj\Debug\DrawTool.o obj\Debug\EinstellungenMenu.o obj\Debug\Fahrt.o obj\Debug\FahrtenlisteMenu.o obj\Debug\Filter.o obj\Debug\INIDatei.o obj\Debug\LogikThread.o obj\Debug\MathTool.o obj\Debug\Ringpuffer.o obj\Debug\Schrift.o obj\Debug\TA_VorVersion_07App.o obj\Debug\TarifeMenu.o  obj\Debug\skript.res   -lgdi32 -luser32 -lkernel32 -lIEICAN02
obj\Debug\CAN.o: In function `ZN4CCAN16MyCAN_CountCardsEv':
C:/Kerstin/Code_Block/ta_project_test/CAN.CPP:20: undefined reference to `_imp___Z14CAN_CountCardsv@0'
obj\Debug\CAN.o: In function `ZN4CCAN19MyCAN_ReadBoardInfoEtP14CAN_BOARD_INFO':

I tried the console already last week, but I'm not really good at. So please have you another idea for me, beside using the console?

MortenMacFly:

--- Quote from: kerstin on September 08, 2008, 01:05:28 pm ---C:/Kerstin/Code_Block/ta_project_test/CAN.CPP:20: undefined reference to `_imp___Z14CAN_CountCardsv@0'
obj\Debug\CAN.o: In function `ZN4CCAN19MyCAN_ReadBoardInfoEtP14CAN_BOARD_INFO':

--- End quote ---
It's hard to tell as I don't know your CAN SDK. Is the *.lib file *really* the import library for the DLL? Is that really all you need? (Is there a bas library you need to add, too)? Do you mix compilers (e.g. using MinGW/GCC for the application build but the rest was build with another compiler)?

There are too much "unknows" to me so I am not in a position to help you. You should ask the developer of the "IEICAN02" library (SDK?!) for help, not me.

If you are an "expert" you could also try to use the symbol table plugin of C::B to analyse which symbols are actually being exported in the library (and probably the DLL). You could also try to link *only* against the DLL (it sounds strange, but MinGW/GCC can do that!) if it's a compiler mismatch error. MinGW/GCC can handle VC libraries just fine usually but I simply don't know sure how the lib/DLL was built.

Sorry, but I can't help more. It's like asking for the content of a blackbox I don't know. Even worse: It's actually *not* a C::B issue so we are violating our forum rules in addition.

kerstin:
Thanks for your help, anyway!!!
At least I know now, that the lib and dll is correct included. Thats something too  :lol:
Kerstin

MortenMacFly:

--- Quote from: kerstin on September 08, 2008, 02:56:37 pm ---At least I know now, that the lib and dll is correct included. Thats something too  :lol:

--- End quote ---
A quick google search revealed this:
http://icp-nmr.com/iei/download/manual/expansion/M_ICAN-02_ENG.pdf
If we are talking about this one and you are in a critical development environment you should really use the MS compiler suite. The library is designed for MS compiler. You can still use C::B (if you like). ;-)

Navigation

[0] Message Index

[*] Previous page

Go to full version