Code::Blocks Forums

User forums => Help => Topic started by: yckx on June 23, 2008, 06:37:32 am

Title: multiple definition error: corrupt makefile?
Post by: yckx on June 23, 2008, 06:37:32 am
I'm getting a few weird multiple definition errors, and it looks like my problem is that Code::Blocks is trying to link the same object file twice. I can't find a makefile for the project anywhere, but here's the relevant portion of the log:

Quote
mingw32-g++.exe -L"C:\Program Files\CodeBlocks\lib"  -o bin\Debug\W32_Framework.exe obj\Debug\core\application.o obj\Debug\gfx\displayfactory.o obj\Debug\gfx\opengldisplay.o obj\Debug\gui\window.o obj\Debug\gui\mainwindow.o obj\Debug\gui\window.o obj\Debug\main.o obj\Debug\app\testapp.o    -lopengl32 -lglu32 -lgdi32

window.o is listed twice. Does anyone know how I can correct this?
Title: Re: multiple definition error: corrupt makefile?
Post by: MortenMacFly on June 23, 2008, 09:09:52 am
window.o is listed twice. Does anyone know how I can correct this?
Post the zipped project file (*.cbp). Most likely you have wrong compiler/linker settings.
Title: Re: multiple definition error: corrupt makefile?
Post by: yckx on June 24, 2008, 03:52:02 am
Post the zipped project file (*.cbp). Most likely you have wrong compiler/linker settings.
Hmm... I just booted it up today after getting home from work, and it compiled fine. I'm not sure exactly what happened, or how it resolved itself. I do know that last night it compiled fine until I renamed a few files, afterwhich the linker started giving weird multiple definition errors, pointing to the same line for the 'first' and the 'multiple' definitions. And the log indicating that it was trying to link the offending file twice. And after fooling with it for entirely too long, I gave up hope.

I can still post the CBP file if you want to take a look at it, but methinks you'd be fixing a phantom issue.