Jump to content
  • Advertisement


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


error in my code

This topic is 6125 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

Hello everyone, I was hoping some of you might know the cause of this error. I have just provided the error, since posting all the code to my simple engine would be too much. Can anyone provide any idea what may be the cause of this error? Linking... Model.obj : error LNK2005: "unsigned int * texture" (?texture@@3PAIA) already defined in main.obj Model.obj : error LNK2005: "unsigned int filter" (?filter@@3IA) already defined in main.obj Debug/fortress.exe : fatal error LNK1169: one or more multiply defined symbols found Error executing link.exe. fortress.exe - 3 error(s), 0 warning(s) Any suggestions would be much appreciated! Thanks in advance, Regards, - Pete

Share this post

Link to post
Share on other sites
That just says your using varable names already in use. Just change ''em to something like texture1 instead of texture and so on.

Alex Broadwin
A-Tronic Software & Design
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"

Share this post

Link to post
Share on other sites
it could also mean that you include a .h file in main.cpp and in model.cpp which defines the variable texture.
To prevent that add
#ifndef FOO_H // if FOO_H is not defined

#define FOO_H 1 // define it (1 is not neccesary)

// all the .h code here

#endif // end the if statement

obviously you would change FOO_H to the name of your file.

Baldur K

"It will be happened; it shall be going to be happening; it will be was an event that could will have been taken place in the future."
--time travel explained by Rimmer (Red Dwarf)

"If you don''t gosub a program loop, you''ll never get a subroutine."
-- Kryten (Red Dwarf)

Share this post

Link to post
Share on other sites

  • 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!