title: Including custom C++ .h and .cpp files in a visual studio code program
body: <p>I am having an issue where I have a ton of custom C/C++ header files (and respective .cpp files) where I would like to include them in other scripts in the visual studio code environment. I'm using windows 10. I thought I understood C/C++, but apparently not. Anyway, my goal is to be able to run something like the code below:</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;JeffsLaboratory_Earth.h&gt; // This causes the error, even though VS code opens the correct file if I right-click on it
  
  int main() {
      int x = 10;
      int y = 20;
      earth ear;
  
      float f = ear.atm_alt_temp_dens;
      std::cout &lt;&lt; &quot;Hello World&quot; &lt;&lt; std::endl;
  }
  </code></pre>
  <p>where &quot;JeffsLaboratory_Earth.h&quot; points to a header file I have, which is in the same folder as the equivalent &quot;JeffsLaboratory_Earth.cpp&quot; file. This folder is local.</p>
  <p>However, I am having tons of difficulty getting this to work. I am also including below the JSON files as well. As you can see, I have included the path to which this library/header file resides, but I am still getting &quot;undefined reference to earth::earth()&quot; and it terminates. Even though VS code will point to the right location of JeffsLaboratory_Earth.h when I right-clock on it. I know for a fact this code and library works, as I have used it in other applications, so that is not the issue. Any help would be much appreciated! Thanks.</p>
  <p>c_cpp_properties.json</p>
  <pre><code>{
      &quot;configurations&quot;: [
          {
              &quot;name&quot;: &quot;Win32&quot;,
              &quot;includePath&quot;: [
                  &quot;${workspaceFolder}/**&quot;,
                  &quot;C:/JeffsLaboratory/commonsoftware/C++/PQRIntegratedSim_libraries&quot;
              ],
              &quot;defines&quot;: [
                  &quot;_DEBUG&quot;,
                  &quot;UNICODE&quot;,
                  &quot;_UNICODE&quot;
              ],
              &quot;cStandard&quot;: &quot;gnu11&quot;,
              &quot;cppStandard&quot;: &quot;gnu++14&quot;,
              &quot;intelliSenseMode&quot;: &quot;gcc-x64&quot;,
              &quot;browse&quot;: {
                  &quot;path&quot;: [
                      &quot;C:\\MinGW\\lib\\gcc\\mingw32\\9.2.0\\include\\c++&quot;
                  ]
              }
          }
      ],
      &quot;version&quot;: 4
  </code></pre>
  <p>task.json</p>
  <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;echo&quot;,
              &quot;type&quot;: &quot;shell&quot;,
              &quot;command&quot;: &quot;g++&quot;,
              &quot;args&quot;: [
                  &quot;-g&quot;, &quot;main.cpp&quot;,
                  &quot;-I&quot;, &quot;C:\\JeffsLaboratory\\commonsoftware\\C++\\PQRIntegratedSim_libraries&quot;,
                  &quot;${file}&quot;
              ],
              &quot;group&quot;: {
                  &quot;kind&quot;: &quot;build&quot;,
                  &quot;isDefault&quot;: true
              }
          }
      ]
  }
  </code></pre>
  <p>launch.json</p>
  <pre><code>{
      // Use IntelliSense to learn about possible attributes.
      // Hover to view descriptions of existing attributes.
      // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
      &quot;version&quot;: &quot;0.2.0&quot;,
      &quot;configurations&quot;: [
          {
              &quot;name&quot;: &quot;(gdb) Launch&quot;,
              &quot;type&quot;: &quot;cppdbg&quot;,
              &quot;request&quot;: &quot;launch&quot;,
              &quot;program&quot;: &quot;${workspaceFolder}/a.exe&quot;,
              &quot;args&quot;: [],
              &quot;stopAtEntry&quot;: false,
              &quot;cwd&quot;: &quot;${workspaceFolder}&quot;,
              &quot;environment&quot;: [],
              &quot;externalConsole&quot;: false,
              &quot;MIMode&quot;: &quot;gdb&quot;,
              &quot;miDebuggerPath&quot;: &quot;C:\\MinGW\\bin\\gdb.exe&quot;,
              &quot;preLaunchTask&quot;: &quot;echo&quot;,
              &quot;setupCommands&quot;: [
                  {
                      &quot;description&quot;: &quot;Enable pretty-printing for gdb&quot;,
                      &quot;text&quot;: &quot;-enable-pretty-printing&quot;,
                      &quot;ignoreFailures&quot;: true
                  }
              ]
          }
      ]
  }
  </code></pre>