Original Post
I'm using a series of sprites to create a GUI for a game i'm working on, however, when converting from a stand alone project to a C++ class i had trouble figuring our where the devices, textures, etc should be declared. it appeared the only way it would work is if they were declare them in my header file (named MenuButton.h) they are declaired as follows: LPDIRECT3DDEVICE9 g_pd3dDevice = NULL; LPDIRECT3DTEXTURE9 g_pMenuTexture = NULL; LPD3DXSPRITE g_pMenuButtonSprite = NULL; however, i now get these errors, which, to me, make no sense - since this is the only place these variables are defined: TestMenu.obj : error LNK2005: "struct IDirect3DDevice9 * g_pd3dDevice" (?g_pd3dDevice@@3PAUIDirect3DDevice9@@A) already defined in MenuButton.obj TestMenu.obj : error LNK2005: "struct IDirect3DTexture9 * g_pMenuTexture" (?g_pMenuTexture@@3PAUIDirect3DTexture9@@A) already defined in MenuButton.obj TestMenu.obj : error LNK2005: "struct ID3DXSprite * g_pMenuButtonSprite" (?g_pMenuButtonSprite@@3PAUID3DXSprite@@A) already defined in MenuButton.obj does anyone know the cause of this? and hopefully a solution? my first thought was just that the .obj files hadn't been updated, so i tried to clean the solution, and continued getting this error, i even deleted the .obj files, and the compiler (visual studio 2005) simply created new ones (as i was hoping) and generated the same errors (not quite what i was expecting). Thanks in advance, Mal'