Archived

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

Nullio

Link Order

Recommended Posts

Here''s the problem, I have _ files: EngineMain.cpp //Main window set up Globals.hpp //Hold all my structs, global vars, etc ddraw.h //DirectDraw header CGameEngine.hpp/cpp //Game Engine object now if I''m correct here EngineMain.cpp holds WinMain() so it will be compiled first, so EngineMain.cpp #includes''s ddraw.h, globals.h, CGameEngine.hpp in that order. But I seem to be getting compile errors from CGameEngine.hpp uses some ddraw.h variables and for some reason ddraw.h isn''t included before CGameEngine.hpp. in what order does Micro$ofts Visual C++ compile and link things in and how to I structure my project to better suite this?? (PLEZ GIVE EXAMPLES!)

Share this post


Link to post
Share on other sites
Each cpp file compiles to an .obj file, so whatever u use inside the cpp, it must be visible.

Make every header file compilable on its own. Include all the stuff that your header uses. Add your header(global.hpp, CGameEngine.hpp) individually to an empty cpp file to test if it can compile on its own.

Share this post


Link to post
Share on other sites