Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

skatermike7

Microsoft Visual C++ and class redefination

This topic is 5305 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am compiling with microsoft Visual c++ 6.0 and trying to use classes. I went through all the hoops creating the classes throught the "new class" feature and have included both .cpp and .h in my project. When i try to compile i come up with these linking errors. Any feedback would be greatly appreciated. myAttemp.obj : error LNK2005: "public: __thiscall LoadBitmapA::LoadBitmapA(void)" (??0LoadBitmapA@@QAE@XZ) already defined in LoadBitmap.obj myAttemp.obj : error LNK2005: "public: virtual __thiscall LoadBitmapA::~LoadBitmapA(void)" (??1LoadBitmapA@@UAE@XZ) already defined in LoadBitmap.obj myAttemp.obj : error LNK2005: "public: long __thiscall LoadBitmapA::LoadFromBitmap(char *)" (?LoadFromBitmap@LoadBitmapA@@QAEJPAD@Z) already defined in LoadBitmap.obj Debug/Zelda.exe : fatal error LNK1169: one or more multiply defined symbols found LoadBitmap::LoadBitmap() { width = 0; height = 0; imageBuffer = NULL; } LoadBitmap::~LoadBitmap() { width = 0; height = 0; if(NULL != imageBuffer) { delete [] imageBuffer; imageBuffer = NULL; } } /*LoadBitmap & LoadBitmap::operator = (LoadBitmap & image) { width = image.GetWidth(); height = image.GetHeight(); SetImageBuffer(image.GetImageBuffer()); return * this; }*/ HRESULT LoadBitmap::LoadFromBitmap(LPSTR filename) { this code was taken out because it was too long and it was a redefiniton linking error anyway }

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!