Linking error (#ifndef doesn't work as expected)
<p>Can't understand what is a problem here:
I have got main.cpp file where I am including:</p>

<pre><code>#include "lexan.h"
...
</code></pre>

<p>The lexan.h file:</p>

<pre><code>#ifndef _LEXAN_
#define _LEXAN_
enum Statements ...
//some function prototypes
...
struct TokensList {
    Statements statement;
    std::string value;
    struct TokensList *next;
};
struct TokensList *tokens = NULL;
#endif _LEXAN_
</code></pre>

<p>In lexan2.h:</p>

<pre><code>#include "lexan.h"
// and some function prototypes
</code></pre>

<p>The problem is that I get the link error 2005:</p>

<pre><code>1&gt;lexan2.obj : error LNK2005: "struct TokensList * tokens" (?tokens@@3PAUTokensList@@A) already defined in lexan.obj
1&gt;main.obj : error LNK2005: "struct TokensList * tokens" (?tokens@@3PAUTokensList@@A) already defined in lexan.obj
</code></pre>

<p>Where is my mistake? I thought the </p>

<pre><code>#ifndef _LEXAN_
#define _LEXAN_
</code></pre>

<p>in the lexan.h file would protect me from such linking problems.</p>
