#if !defined(MYHEADERFILE)
#define MYHEADERFILE
//FUnctions and vars
...
#endif
Ive also tried #ifndef and it doesn''t work either. Heres the errors I''m getting
Linking...
main.obj : error LNK2005: "void __cdecl ErrMsg(char *)" (?ErrMsg@@YAXPAD@Z) already defined in CGame.obj
main.obj : error LNK2005: "void __cdecl DxErrMsg(long,char *)" (?DxErrMsg@@YAXJPAD@Z) already defined in CGame.obj
Debug/zbuffer.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
Multiple Source Files
Why doesn''t any thing work without tweaking for hours? I''ve used multiple source files before and it worked but now I''m working tutorials on www.andypike.com. Im on the fourth one and it uses multiple source files. I have a header that defines some variables and one that defines some functions. To keep them from redefining themselves in multiple source files I use
Not sure why it doesn''t work, but here is how I type it.
#ifndef __MY_HEADER__
#define __MY_HEADER__
.... code ....
#endif // end __MY_HEADER__
#ifndef __MY_HEADER__
#define __MY_HEADER__
.... code ....
#endif // end __MY_HEADER__
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement