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


Multiple Source Files

Recommended Posts

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 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
#if !defined(MYHEADERFILE)

//FUnctions and vars



Ive also tried #ifndef and it doesn''t work either. Heres the errors I''m getting
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.  

Share this post

Link to post
Share on other sites