Code::Blocks Forums
Developer forums (C::B DEVELOPMENT STRICTLY!) => Contributions to C::B => Topic started by: ebl on August 25, 2007, 02:54:57 am
-
i have draw.h and draw.o i have included draw.h but when i compile it i get this anouncment
.objs\LabCTo21.o:LabCTo21.c:(.text+0x114): undefined reference to `InitializeCards'
when InitializeCards() is a func in draw.o declared in draw.h
so what do i need to do in order to include draw.o
thanks
-
So you have the .o file but not the original .c/.cpp file...
Try this: Go to Project, Build options..., Linker settings (tab) and add draw.o in Other linker options.
-
it's not working
yes i have draw.o and draw.h
-
Please switch Settings->Compiler and Debugger...->Other settings->Compiler logging to Full command line and post the build log.
-
Do the following.
1) Add draw.o file to project. It will be added to Other section in the project tree.
2) Right click on the draw.o file in the project tree and click on Properties option.
3) Go to Build tab of File properties window and check the Link file option.
This should solve your problem.
-
i have truied what you said and still this is what i get:
RandCardDraw.o - the object file
mingw32-g++.exe -LC:\Programs\programing\CodeBlocks\lib -o C:\workspace\GameCard.exe .objs\RandCardDraw.o .objs\LabCTo21.o
.objs\LabCTo21.o:LabCTo21.c:(.text+0x114): undefined reference to `InitializeCards'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)