Game Development Community

Map2dif VC6 linking error (LNK2005)

by Cory Osborn · in Torque Game Engine · 10/19/2003 (6:02 pm) · 2 replies

Anybody have any clues on where the problem might be?

engine_DEBUG.lib(guiCanvas.obj) : error LNK2005: "public: void __thiscall GuiCanvas::paint(void)" (?paint@GuiCanvas@@QAEXXZ) already defined in main.obj
engine_DEBUG.lib(guiCanvas.obj) : error LNK2005: "class GuiCanvas *  Canvas" (?Canvas@@3PAVGuiCanvas@@A) already defined in main.obj
../tools/map2dif_DEBUG.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.

#1
10/19/2003 (6:29 pm)
Looks like guiCanvas.cc
was added to both the Map2Diff project
and the engine.
#2
10/19/2003 (7:00 pm)
Just looked at the code in /tools/map2dif/main.cc (with latest HEAD) and I found this block (and yes those comments are in the code)
#if defined(TORQUE_OS_WIN32) // huger hack
// huge hack
GuiCanvas *Canvas;
void GuiCanvas::paint() {}
#endif

The last revision to this is dated 4/3/2003 and I've noticed a lot of changes to GuiCanvas recently. Removing this block of code allows it to compile nicely. Since its labeled as a hack, I'll assume they were originally there to get it to compile properly so removing it should be no big deal.