header file - containing......header files

Started by
12 comments, last by DrunkenHyena 19 years, 2 months ago
ok. I got rid of the error saying that the functions were undeclared, but now I get linker errors:

graphics.obj : error LNK2005: "struct IDirect3DVertexBuffer9 * g_pVB" (?g_pVB@@3PAUIDirect3DVertexBuffer9@@A) already defined in DX9 init.obj

graphics.obj : error LNK2005: "struct IDirect3DDevice9 * g_pd3dDevice" (?g_pd3dDevice@@3PAUIDirect3DDevice9@@A) already defined in DX9 init.obj

graphics.obj : error LNK2005: "struct IDirect3D9 * g_pD3D" (?g_pD3D@@3PAUIDirect3D9@@A) already defined in DX9 init.obj

render.obj : error LNK2005: "struct IDirect3DVertexBuffer9 * g_pVB" (?g_pVB@@3PAUIDirect3DVertexBuffer9@@A) already defined in DX9 init.obj

render.obj : error LNK2005: "struct IDirect3DDevice9 * g_pd3dDevice" (?g_pd3dDevice@@3PAUIDirect3DDevice9@@A) already defined in DX9 init.obj

render.obj : error LNK2005: "struct IDirect3D9 * g_pD3D" (?g_pD3D@@3PAUIDirect3D9@@A) already defined in DX9 init.obj

D3D init crap.obj : error LNK2005: "struct IDirect3DVertexBuffer9 * g_pVB" (?g_pVB@@3PAUIDirect3DVertexBuffer9@@A) already defined in DX9 init.obj

D3D init crap.obj : error LNK2005: "struct IDirect3DDevice9 * g_pd3dDevice" (?g_pd3dDevice@@3PAUIDirect3DDevice9@@A) already defined in DX9 init.obj

D3D init crap.obj : error LNK2005: "struct IDirect3D9 * g_pD3D" (?g_pD3D@@3PAUIDirect3D9@@A) already defined in DX9 init.obj

Debug/D3D init crap.exe : fatal error LNK1169: one or more multiply defined symbols found



GAHHHHHHHHHHHHHHH
Advertisement
try cleaning the project

cleared it. didn't work. this sucks. I looked in my DX9 init files and no where in them are the definitions of the functions I am getting linker errors for.
Quote:Original post by CreepingDeath666
ok. I got rid of the error saying that the functions were undeclared, but now I get linker errors:

graphics.obj : error LNK2005: "struct IDirect3DVertexBuffer9 * g_pVB" (?g_pVB@@3PAUIDirect3DVertexBuffer9@@A) already defined in DX9 init.obj


This is because you are declaring these variable in your header files, so every cpp file creates a new one.

I'm sure you're going to take this the wrong way, but you need to go through some C++ tutorials or get yourself a good book on the subject before you tackle something like DirectX.
Stay Casual,KenDrunken Hyena

This topic is closed to new replies.

Advertisement