title: VSCode C++ compile with own header files
body: <p>How do I convince VSCode to compile my C++ program with my own header files? I just can't figure it out.</p>
  <p>Minimal example with the following directory structure:</p>
  <pre><code>workdir/main.cpp
  workdir/test.h
  workdir/test.cpp
  </code></pre>
  <p>Content of the <code>main.cpp</code>:</p>
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt;
  #include &quot;test.h&quot;
  
  int main()
  {
      std::cout &lt;&lt; &quot;Hello world!&quot; &lt;&lt; std::endl;
      print_stuff();
  }
  </code></pre>
  <p>Content of <code>test.h</code>:</p>
  <pre class="lang-cpp prettyprint-override"><code>#pragma once
  
  void print_stuff(void);
  </code></pre>
  <p>Content of <code>test.cpp</code>:</p>
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt;
  
  void print_stuff()
  {
      std::cout &lt;&lt; &quot;Stuff&quot; &lt;&lt; std::endl;
  }
  </code></pre>
  <p>From the command line, compiling with <code>g++ -o main.exe main.cpp --std=gnu++17 test.cpp</code> works. Even VSCode's intellisense correctly finds the functions, but still can't compile.</p>
  <p>I've tried modifying the <code>includePath</code> in the <code>configurations.json</code>, but so far without any success:</p>
  <pre><code>{
      &quot;configurations&quot;: [
          {
              &quot;name&quot;: &quot;Linux&quot;,
              &quot;includePath&quot;: [
                  &quot;${workspaceFolder}/**&quot;
              ],
              &quot;defines&quot;: [],
              &quot;compilerPath&quot;: &quot;/usr/bin/gcc&quot;,
              &quot;cStandard&quot;: &quot;gnu17&quot;,
              &quot;cppStandard&quot;: &quot;gnu++14&quot;,
              &quot;intelliSenseMode&quot;: &quot;linux-gcc-x64&quot;
          }
      ],
      &quot;version&quot;: 4
  }
  </code></pre>