Skip to main content
gamedev.net
🔒 Locked

Link Order

Started by Nullio 0 replies 300+ views
Original Post
Nullio
Nullio
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!)
Void
Void
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.