title: C++ compile with Filesystem library
body: <h2>Note:</h2>
  <p>It turns out that this question has been asked before. However, the answer to the duplicate question uses an old workaround. As commented by &quot;Mat&quot; below, these days we can just make sure that we're using a newer compiler. For <code>gcc</code> we need at least <code>version 8</code>:</p>
  <pre><code>g++-8 -std=c++17 demo.cpp
  </code></pre>
  <p>And assumedly something similar in <code>clang</code>/<code>msvc</code>.</p>
  <h2>Original question:</h2>
  <p>I want to be able to use the C++17 Filesystem library</p>
  <p>I am compiling using bash as follows:</p>
  <pre><code>g++ -std=c++17 demo.cpp
  </code></pre>
  <p>the demo.cpp file:</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;filesystem&gt;
  
  namespace fs = std::filesystem;
  
  int main () 
  {
      return 0;
  }
  </code></pre>
  <p>The code is really just a simplified version of what's listed on cppreference:
  <a href="http://en.cppreference.com/w/cpp/filesystem/path/path" rel="nofollow noreferrer">http://en.cppreference.com/w/cpp/filesystem/path/path</a></p>
  <p>However the code for me won't compile, with the following error:</p>
  <pre><code>fatal error: filesystem: No such file or directory
  </code></pre>
  <p>I am currently using: gcc version 5.5.0 20171010 (Ubuntu 5.5.0-12ubuntu1~16.04)</p>
  <p>If my command prompt is incorrect, could you please tell me what I'm missing? preferably still using g++?</p>
  <p>Otherwise could you tell me if it works on your system? (so that I know that this is an issue with my compiler)</p>