Question: I have a big project (400 files) and all of the headers have include guards and everything, however I get 500 LNK2005 errors. 

Could it be that I have function bodies defined in some headers? Cause I saw the same things in the DirectX utility headers(DirectXCollision has some of it's functions are completely in the header).

Or could it be because they are using .inl files instead of .cpp?

Answer: 
> 
> Could it be that I have function bodies defined in some headers?
> 
> 
> 

Yes, that could be. Defining a function in more than one translation unit results in a duplicated symbol definition error.

You can get around the duplication error by declaring those functions `inline`. *[7.1.2]/2* reads:

> 
> A function declaration (8.3.5, 9.3, 11.3) with an inline specifier declares an *inline function*. The inline specifier indicates to the implementation that inline substitution of the function body at the point of call is to be preferred to the usual function call mechanism. An implementation is not required to perform this inline substitution at the point of call; however, even if this inline substitution is omitted, the other rules for inline functions defined by 7.1.2 shall still be respected.
> 
> 
>
Do you define global variables in your header files? That can be a cause of the error.
And include guards will not help. 

A global variable should be defined only in one translation unit and should be externed in all other translational unit.

For eg.
in x.h, you have

```
int myVar;

```

Now you #include x.h in both a.cpp & b.cpp,
then you will get a linker error even if you had include guards in x.h

Because now myVar will get defined in both a.obj and b.obj and the linker will find 2 myVars.