Advertisement

error in my code

Started by December 18, 2001 09:19 AM
1 comment, last by csxpcm 23 years, 2 months ago
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
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!"
Alex BroadwinA-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!"
Advertisement
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)

This topic is closed to new replies.

Advertisement