Archived

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

Multiple files and includes

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

I am getting LNK2005 errors saying that everything is already defined in the WinMain.obj. What am I doing wrong? -------------------- //WinMain.cpp file #include "Main.h" //prototypes GameInit(); GameMain(); GameShutdown(); //contains WinProc() { } WinMain() { GameInit(); GameLoop(); GameShutdown(); } --------------------- //Main.h file (the one file to rule them all) #ifndef Main #define Main //contains windows, Dx and C/C++ includes macros typedefs globals structures 3D math, 3D pipeline, graphics algorithms and ddraw prototypes #endif --------------------- // Draw.cpp file (ddraw functions) #include "Main.h" //contains dx graphics functions --------------------- // Graphics.cpp file (graphics algorithms) #include "Main.h" //contains graphics algorithmic functions --------------------- //Engine.cpp file (3D math and 3D pipeline fuctions) #include "Main.h" //contains 3D math and 3D pipeline fuctions ---------------------- [edited by - DomainMaster on December 14, 2003 10:41:31 PM] [edited by - DomainMaster on December 14, 2003 12:37:34 AM]

Share this post


Link to post
Share on other sites