Author Topic: multiple definition error: corrupt makefile?  (Read 7711 times)

Offline yckx

  • Multiple posting newcomer
  • *
  • Posts: 10
    • http://
multiple definition error: corrupt makefile?
« 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?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: multiple definition error: corrupt makefile?
« Reply #1 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline yckx

  • Multiple posting newcomer
  • *
  • Posts: 10
    • http://
Re: multiple definition error: corrupt makefile?
« Reply #2 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.