Strange error message-multiple definition

I'm having trouble with one of my programs which is behaving weirdly. It looks like it compiles fine, but then I get this in the compile log:
Compiler: Default GCC compiler
Building Makefile: "G:\C\BGF Raid\Makefile.win"
Executing make clean
rm -f Objects/MingW/main.o Objects/MingW/netmap.o Objects/MingW/netclasses.o Output/MingW/BGF\ Raid.exe

g++.exe -c Source/main.cpp -o Objects/MingW/main.o -I"C:/Program Files (x86)/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Program Files (x86)/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Program Files (x86)/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Program Files (x86)/Dev-Cpp/include/c++/3.4.2" -I"C:/Program Files (x86)/Dev-Cpp/include" -I"C:/Program Files (x86)/Dev-Cpp/" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/msw" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/generic" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/fl" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/gizmos" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/html" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/mmedia" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/net" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/ogl" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/plot" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/protocol" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/stc" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/svg" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/xml" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/xrc" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx" -I"C:/Program Files (x86)/Dev-Cpp/include/common"

g++.exe -c Source/netmap.cpp -o Objects/MingW/netmap.o -I"C:/Program Files (x86)/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Program Files (x86)/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Program Files (x86)/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Program Files (x86)/Dev-Cpp/include/c++/3.4.2" -I"C:/Program Files (x86)/Dev-Cpp/include" -I"C:/Program Files (x86)/Dev-Cpp/" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/msw" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/generic" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/fl" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/gizmos" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/html" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/mmedia" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/net" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/ogl" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/plot" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/protocol" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/stc" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/svg" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/xml" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/xrc" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx" -I"C:/Program Files (x86)/Dev-Cpp/include/common"

g++.exe -c Source/netclasses.cpp -o Objects/MingW/netclasses.o -I"C:/Program Files (x86)/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Program Files (x86)/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Program Files (x86)/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Program Files (x86)/Dev-Cpp/include/c++/3.4.2" -I"C:/Program Files (x86)/Dev-Cpp/include" -I"C:/Program Files (x86)/Dev-Cpp/" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/msw" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/generic" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/fl" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/gizmos" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/html" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/mmedia" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/net" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/ogl" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/plot" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/protocol" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/stc" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/svg" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/xml" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx/xrc" -I"C:/Program Files (x86)/Dev-Cpp/include/common/wx" -I"C:/Program Files (x86)/Dev-Cpp/include/common"

g++.exe Objects/MingW/main.o Objects/MingW/netmap.o Objects/MingW/netclasses.o -o "Output\MingW\BGF Raid.exe" -L"C:/Program Files (x86)/Dev-Cpp/Lib"

Objects/MingW/netmap.o:netmap.cpp:(.text+0x100): multiple definition of `setcolor(unsigned short)'
Objects/MingW/main.o:main.cpp:(.text+0x0): first defined here
Objects/MingW/netmap.o:netmap.cpp:(.text+0x138): multiple definition of `gotoxy(int, int)'
Objects/MingW/main.o:main.cpp:(.text+0x138): first defined here
Objects/MingW/netmap.o:netmap.cpp:(.text+0x182): multiple definition of `clrscr()'
Objects/MingW/main.o:main.cpp:(.text+0x182): first defined here
Objects/MingW/netclasses.o:netclasses.cpp:(.text+0x0): multiple definition of `setcolor(unsigned short)'
Objects/MingW/main.o:main.cpp:(.text+0x0): first defined here
Objects/MingW/netclasses.o:netclasses.cpp:(.text+0x138): multiple definition of `gotoxy(int, int)'
Objects/MingW/main.o:main.cpp:(.text+0x138): first defined here
Objects/MingW/netclasses.o:netclasses.cpp:(.text+0x182): multiple definition of `clrscr()'
Objects/MingW/main.o:main.cpp:(.text+0x182): first defined here
collect2: ld returned 1 exit status

mingw32-make.exe: *** [Output/MingW/BGF Raid.exe] Error 1

Execution terminated


The code is posted at http://dl.getdropbox.com/u/285110/BGF%20Raid.7z (It's a .7z file) until the question is solved. I'm using wxDev-C++, latest version.

The part I don't get is
netclasses.cpp:(.text+0x182)

Can someone clear that up so that I understand what I'm doing wrong?
Is setcolor, goto and clrscr defined in a header file, but not inlined?
yeah, none of them are inlined.
But when I change void setcolor(unsigned short color) to inline void setcolor(unsigned short color) it still gives the same errors.
clrscr and gotoxy are in gotoxy.hpp, and setcolor is in colors.hpp inside the .7z file I provided.
If you recompile everything with the inlined functions, it should link correctly.
0.o that's strange
I compiled the exact same way (complete rebuild-I always do it) and it worked! Thank you, kbw!
Now...why does that fix it?
I suspect you had an old object file lying around that had a copy of on of the newly inlined functions.
Topic archived. No new replies allowed.