title: VS Code will not build c++ programs with multiple .ccp source files
body: <p>Note that I'm using VS Code on Ubuntu 17.10 and using the GCC Compiler.</p>
  <p>I'm having trouble building a simple program which makes use of additional .ccp files. I'm probably missing something obvious here as I'm fairly new to programming but I'll explain what I've done so far. This is something that is stopping me from continuing with a tutorial I'm doing.</p>
  <p>I have written a very simple program to demonstrate my point as follows.</p>
  <h1>main.ccp</h1>
  <hr />
  <pre><code>#include &lt;iostream&gt;
  #include &quot;Cat.h&quot;
  
  using namespace std;
  
  int main ()
  {
  
  speak();
  
  return 0;
  }
  </code></pre>
  <h1>Cat.h</h1>
  <hr />
  <pre><code>#pragma once
  
  
  
  void speak();
  </code></pre>
  <h1>Cat.ccp</h1>
  <hr />
  <pre><code>#include &lt;iostream&gt;
  #include &quot;Cat.h&quot;
  
  using namespace std;
  
  void speak()
  {
  std::cout &lt;&lt; &quot;Meow!!&quot; &lt;&lt; std::endl;
  
  }
  </code></pre>
  <p>This simple program builds in both Codeblocks and Visual Studio Community 2017 no problem and I can't figure out what I need to do to make it run.
  This error at the bottom indicates that the Cat.ccp file is not being picked up at all. If I was to drop the definition from this Cat.ccp into the header file the program compiles and runs fine but I need to make use of that .ccp file as I understand this is the accepted way of separating code. I'll note that all the files are in the same folder too.</p>
  <p>I understand that I may need to tell VS Code where to look for the Cat.ccp file but it's strange to me that it finds the header in the same location. Nevertheless, after looking online I've been reading that I may need to place a directory into the c_cpp_intellisense_properties.json. Here's what mine looks like.</p>
  <pre><code>{
  &quot;configurations&quot;: [
      {
          &quot;name&quot;: &quot;Mac&quot;,
          &quot;includePath&quot;: [
              &quot;/usr/include&quot;,
              &quot;/usr/local/include&quot;,
              &quot;${workspaceRoot}&quot;
          ],
          &quot;defines&quot;: [],
          &quot;intelliSenseMode&quot;: &quot;clang-x64&quot;,
          &quot;browse&quot;: {
              &quot;path&quot;: [
                  &quot;/usr/include&quot;,
                  &quot;/usr/local/include&quot;,
                  &quot;${workspaceRoot}&quot;
              ],
              &quot;limitSymbolsToIncludedHeaders&quot;: true,
              &quot;databaseFilename&quot;: &quot;&quot;
          },
          &quot;macFrameworkPath&quot;: [
              &quot;/System/Library/Frameworks&quot;,
              &quot;/Library/Frameworks&quot;
          ]
      },
      {
          &quot;name&quot;: &quot;Linux&quot;,
          &quot;includePath&quot;: [
              &quot;/usr/include/c++/7&quot;,
              &quot;/usr/include/x86_64-linux-gnu/c++/7&quot;,
              &quot;/usr/include/c++/7/backward&quot;,
              &quot;/usr/lib/gcc/x86_64-linux-gnu/7/include&quot;,
              &quot;/usr/local/include&quot;,
              &quot;/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed&quot;,
              &quot;/usr/include/x86_64-linux-gnu&quot;,
              &quot;/usr/include&quot;,
              &quot;/home/danny/Documents/C++_Projects/24_-_Classes/Cat.cpp&quot;,
              &quot;${workspaceRoot}&quot;,
              &quot;/home/danny/Documents/C++_Projects/24_-_Classes/&quot;,
              &quot;/home/danny/Documents/C++_Projects/24_-_Classes/.vscode&quot;,
              &quot;/home/danny/Documents/C++_Projects/24_-_Classes/.vscode/Cat.cpp&quot;
          ],
          &quot;defines&quot;: [],
          &quot;intelliSenseMode&quot;: &quot;clang-x64&quot;,
          &quot;browse&quot;: {
              &quot;path&quot;: [
                  &quot;/usr/include/c++/7&quot;,
                  &quot;/usr/include/x86_64-linux-gnu/c++/7&quot;,
                  &quot;/usr/include/c++/7/backward&quot;,
                  &quot;/usr/lib/gcc/x86_64-linux-gnu/7/include&quot;,
                  &quot;/usr/local/include&quot;,
                  &quot;/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed&quot;,
                  &quot;/usr/include/x86_64-linux-gnu&quot;,
                  &quot;/usr/include&quot;,
                  &quot;${workspaceRoot}&quot;,
                  &quot;/home/danny/Documents/C++_Projects/24_-_Classes/&quot;,
                  &quot;/home/danny/Documents/C++_Projects/24_-_Classes/.vscode/Cat.cpp&quot;
              ],
              &quot;limitSymbolsToIncludedHeaders&quot;: true,
              &quot;databaseFilename&quot;: &quot;&quot;
          }
      },
      {
          &quot;name&quot;: &quot;Win32&quot;,
          &quot;includePath&quot;: [
              &quot;C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include&quot;,
              &quot;${workspaceRoot}&quot;
          ],
          &quot;defines&quot;: [
              &quot;_DEBUG&quot;,
              &quot;UNICODE&quot;
          ],
          &quot;intelliSenseMode&quot;: &quot;msvc-x64&quot;,
          &quot;browse&quot;: {
              &quot;path&quot;: [
                  &quot;C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include/*&quot;,
                  &quot;${workspaceRoot}&quot;
              ],
              &quot;limitSymbolsToIncludedHeaders&quot;: true,
              &quot;databaseFilename&quot;: &quot;&quot;
          }
      }
  ],
  &quot;version&quot;: 3
  }
  </code></pre>
  <p>At one point I wondered if I need to add a double command in there to tell the compiler to build both .ccp files in the <em>tasks.json</em> but I haven't managed to figure out how to do that, or even if that's the right approach.</p>
  <h1>tasks.json</h1>
  <hr />
  <pre><code>{
  // See https://go.microsoft.com/fwlink/?LinkId=733558
  // for the documentation about the tasks.json format
  &quot;version&quot;: &quot;2.0.0&quot;,
  &quot;tasks&quot;: [
      {
          &quot;label&quot;: &quot;Build&quot;,
          &quot;type&quot;: &quot;shell&quot;,
          &quot;command&quot;: &quot;g++ -g /home/danny/Documents/C++_Projects/24_-_Classes/main.cpp -o Classes&quot;,
          &quot;group&quot;: {
              &quot;kind&quot;: &quot;build&quot;,
              &quot;isDefault&quot;: true
          },
          &quot;problemMatcher&quot;:&quot;$gcc&quot;
      }
  ]
  }
  </code></pre>
  <p>Appreciate any help. And just in case you're wondering, the reason I don't just finish the tutorial in Codeblocks or VS Community is that I like to know what's going on under the hood in most things. Plus I'd like to get VS Code working for me as it's been great so far.</p>