Archived

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

error in my code

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 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.

A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."

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.
  #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)

• Forum Statistics

• Total Topics
628401
• Total Posts
2982463

• 9
• 10
• 9
• 19
• 24