News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

multiple definition error: corrupt makefile?

Started by yckx, June 23, 2008, 06:37:32 AM

Previous topic - Next topic

yckx

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:

Quotemingw32-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?

MortenMacFly

Quote from: yckx on June 23, 2008, 06:37:32 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

yckx

Quote from: MortenMacFly on June 23, 2008, 09:09:52 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.