title: How to use functions from different C++ projects in Visual Studio 2010?
body: <p>I would like to build two C++ projects in the same solution in Visual Studio 2010 that can interact with each other. I have created a solution under directory <code>C:\Users\me\Desktop\SolutionDir</code>. The two projects have been created respectively under <code>C:\Users\me\Desktop\SolutionDir\FirstProject</code> and <code>C:\Users\me\Desktop\SolutionDir\SecondProject</code>.</p>
  
  <p>My first project contains two files, a header <code>function.h</code> and a cpp file <code>function.cpp</code></p>
  
  <h3>function.h</h3>
  
  <pre class="lang-cpp prettyprint-override"><code>#pragma once
  void print_stuff();
  </code></pre>
  
  <h3>function.cpp</h3>
  
  <pre class="lang-cpp prettyprint-override"><code>#include "function.h"
  #include &lt;iostream&gt;
  
  void print_stuff() {
      std::cout &lt;&lt; "hello world" &lt;&lt; std::endl;
  }  
  </code></pre>
  
  <p>My second project contains the main file <code>main.cpp</code></p>
  
  <h3>main.cpp</h3>
  
  <pre class="lang-cpp prettyprint-override"><code>#include "FirstProject\function.h"
  #include &lt;iostream&gt;
  
  int main(void) {
      print_stuff();
  
      int stop;
      std::cin &gt;&gt; stop;
      return 0;
  }  
  </code></pre>
  
  <p>I added the directory <code>C:\Users\me\Desktop\SolutionDir\</code> in my SecondProject <code>Configuration Properties &gt; C/C++ &gt; General &gt; Additional Include Directories</code>. I still get the classical error : <code>error LNK2019: unresolved external symbol</code> when calling the function <code>print_stuff()</code>.</p>
  
  <p>Any ideas ?</p>