 <p>With the <code>extern</code> clause you are telling the compiler to resolve that symbol when it links. After linking, in the binary file there will be just one symbol with the name <code>ptr_to_var</code>. You, of course, must assure that it gets initialised somewhere. In the code you pasted, we cannot know whether it's been initialised or not. Though it seems you didn't. </p> <p>By the way, try to make an <code>nm</code> to the libraries. You will see the symbols that you specified as <code>extern</code> as undefined (capital u), except in that library or object file where is it indeed defined (i.e., declared without the <code>extern</code> clause).</p>