   Linker
  ok Im having this weird problem. I got this project, and in this project I have"namespace extra" ok and I wasnted to add "D3DXMATRIX obj;" but every time I do that, I get errors.camera.obj : error LNK2005: "struct D3DXMATRIX extra::obj" (?obj@extra@@3UD3DXMATRIX@@A) already defined in aiSubsystem.objevents.obj : error LNK2005: "struct D3DXMATRIX extra::obj" (?obj@extra@@3UD3DXMATRIX@@A) already defined in aiSubsystem.objextra.obj : error LNK2005: "struct D3DXMATRIX extra::obj" (?obj@extra@@3UD3DXMATRIX@@A) already defined in aiSubsystem.objGame.obj : error LNK2005: "struct D3DXMATRIX extra::obj" (?obj@extra@@3UD3DXMATRIX@@A) already defined in aiSubsystem.objI dont get it. I cant add anything, I cant even add a new class to the project, Ive tried deleting the obj files and compiling the entire project, that didnt work. sorry for such a noob question, but I just couldnt figure out whats wrong.im using VS 2005.   
  It looks like you have a definition of an object in a header file, probably. Put the definition in a single source file, and declare it extern in the header.   ;  It looks to me as though you have initialised a variable in the header file. Take that out and see if your problem is solved.Dave   ;  A variable must only be defined in one compilation unit. You should declare it as extern in all compilation units but one (which is responsible for defining it, and where it makes sense, semantically, to place that variable).   ;  take out "D3DXMATRIX obj"? I kinda need this. and this isnt even being initilized anywhere yet.   ;  ok I tried a didd approach. I created a class called Test and added that to my projectTest.h#ifndef __TestH__#define __TestH__#include <d3dx9.h>class Test{public:Test();~Test();private:D3DXMATRIX obj;}Test1;#endif //__TestH__and when I added this Test.h to my project im getting this error:Test.obj : error LNK2005: "class Test Test1" (?Test1@@3VTest@@A) already defined in Game.obj;  anyone know why I cant add anything to my project. I also tried to add a namespace gave me the same errors   ;  A variable, such as Test1, must only be defined in one compilation unit. You should declare it as extern in all compilation units but one (which is responsible for defining it, and where it makes sense, semantically, to place that variable).   ;test.h#ifndef __TestH__#define __TestH__#include <d3dx9.h>class Test{public:Test();~Test();private:D3DXMATRIX obj;};extern Test Test1; // declare it#endiftest.cpp#include "test.h"Test Test1;// define itTest::Test(){//...}Test::~Test(){//...}