Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Already defined in .obj

Status
Not open for further replies.

JimmyFo

Programmer
Feb 14, 2005
102
US
Hi, I'm getting a really frustrating error I can't get rid off. It reads like:

Fickleton error LNK2005: "public: void __thiscall world::removeGoal(class goal)" (?removeGoal@world@@$$FQAEXVgoal@@@Z) already defined in Gameworld.obj

There are 25 errors, 24 of which are 2 occurences of class functions like the ones above, then one final that says:

Fickleton fatal error LNK1169: one or more multiply defined symbols found

I only have three files, because I've been trying to compress the files to get rid of this error to no avail. I have a main cpp file which includes only: windows.h, gl/gl.h, and a custom cpp file. This cpp file has #ifndef/#define/#endif statements in it and includes only my custom header. This is ALSO covered with #ifndef/#define/#endif statements and includes only vector, stdlib, and using namespace std.

What is wrong with this picture?
 
Are you also linking the object generated by the custom .cpp file? If so, you have 2: one in main.cpp and one by itself.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top