Original Post
Help help!
I havent been able to get past a basic framework for the game I am working on because it wont link. All the individual objects compile fine but it gives me the following every time it reaches the linker:
--------------------Configuration: Project 1 - Win32 Debug--------------------
Compiling...
main.cpp
Linking...
LoadBitmap.obj : error LNK2005: "struct IDirectDrawClipper * lpClipper" (?lpClipper@@3PAUIDirectDrawClipper@@A) already defined in DirectDraw.obj
LoadBitmap.obj : error LNK2005: "struct IDirectDrawSurface7 * lpBack" (?lpBack@@3PAUIDirectDrawSurface7@@A) already defined in DirectDraw.obj
LoadBitmap.obj : error LNK2005: "struct IDirectDrawSurface7 * lpPrimary" (?lpPrimary@@3PAUIDirectDrawSurface7@@A) already defined in DirectDraw.obj
LoadBitmap.obj : error LNK2005: "struct IDirectDraw7 * lpDD7" (?lpDD7@@3PAUIDirectDraw7@@A) already defined in DirectDraw.obj
main.obj : error LNK2005: "struct IDirectDrawClipper * lpClipper" (?lpClipper@@3PAUIDirectDrawClipper@@A) already defined in DirectDraw.obj
main.obj : error LNK2005: "struct IDirectDrawSurface7 * lpBack" (?lpBack@@3PAUIDirectDrawSurface7@@A) already defined in DirectDraw.obj
main.obj : error LNK2005: "struct IDirectDrawSurface7 * lpPrimary" (?lpPrimary@@3PAUIDirectDrawSurface7@@A) already defined in DirectDraw.obj
main.obj : error LNK2005: "struct IDirectDraw7 * lpDD7" (?lpDD7@@3PAUIDirectDraw7@@A) already defined in DirectDraw.obj
main.obj : error LNK2005: "struct HINSTANCE__ * hinstance_app" (?hinstance_app@@3PAUHINSTANCE__@@A) already defined in DirectDraw.obj
main.obj : error LNK2005: "struct HWND__ * main_window_handle" (?main_window_handle@@3PAUHWND__@@A) already defined in DirectDraw.obj
main.obj : error LNK2005: "bool active_app" (?active_app@@3_NA) already defined in DirectDraw.obj
LoadBitmap.obj : error LNK2001: unresolved external symbol _DDLoadBitmap
Debug/Project 1.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Project 1.exe - 13 error(s), 0 warning(s)
----------------------------------------------------------------------------
I have the source zipped up and ready to be added to a project. It even includes a bitmap to output if it can get correctly linked. I tried using extern #ifndef #define and #including the headers in all sorts of different places. I think I am getting the errors because my Globals.h is being included in multiple files even though it shouldnt.
code is at http://filebox.vt.edu/users/mijohn12/ProblemCode.zip
Help me code-monkeys. You are my only hope.