title: How to include CPP files that don't exist yet?
body: <p>I have a class Game that serves as an interface, and two classes Poker and BlackJack that implement this interface. I have this method that returns a list of Game objects that I can then use:</p>
  <pre><code>#include &quot;Poker.h&quot;
  #include &quot;BlackJack.h&quot;
           ...
  std::vector&lt;Game*&gt; getGames() {
      std::vector&lt;Game*&gt; gs;
      Game* p = new Poker();
      gs.push_back(p);
      Game* b = new BlackJack();
      gs.push_back(b);
      return gs;
  }
  </code></pre>
  <p>At the moment it can only return a list containing these two classes. I want to be able to write more implementations of this interface or get other people's implementations, drop the CPP file in some directory, and be able to call this method, except now with the vector also containing an instance of this new class.</p>
  <p>So far I have:</p>
  <pre><code>std::string path = &quot;/Games&quot;;
  std::vector&lt;std::string&gt; filePaths;
  for (const auto&amp; file : std::filesystem::directory_iterator(path)) {
      filePaths.push_back(file.path().string());
  }
  </code></pre>
  <p>Which creates a list of file paths in some directory.</p>
  <p>I have no idea how to continue from here since in order to use these files I would have to add an include statement each time. The end goal is to have a program that users could very easily import their own games onto. How could I go about doing this?</p>