title: Cannot use `std::filesystem` even if declared supported
body: <p>The latest versions of GCC and clang support C++17's std::filesystem (<a href="https://en.cppreference.com/w/cpp/compiler_support#cpp17" rel="nofollow noreferrer">ref</a>).</p>
  
  <p>Why does this program not compile?</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;cstdlib&gt;
  #include &lt;filesystem&gt;
  namespace fs = std::filesystem;
  
  int main()
  {
      fs::create_directories("sandbox/1/2/a");
      fs::create_directory("sandbox/1/2/b");
   //   fs::permissions("sandbox/1/2/b", fs::perms::remove_perms | fs::perms::others_all);
      fs::create_directory("sandbox/1/2/c", "sandbox/1/2/b");
      std::system("ls -l sandbox/1/2");
      fs::remove_all("sandbox");
  }
  </code></pre>
  
  <p>I tested it with the latest compiler versions from an <a href="https://wandbox.org/" rel="nofollow noreferrer">online compiler</a>, with the following compiler options:</p>
  
  <pre><code>clang++ prog.cc -Wall -Wextra -std=c++17
  g++ prog.cc -Wall -Wextra -std=c++2a
  </code></pre>
  
  <p>From clang I get these linker errors:</p>
  
  <pre><code>/tmp/prog-9b6259.o: In function `main':
  prog.cc:(.text+0x48): undefined reference to `std::__1::__fs::filesystem::__create_directories(std::__1::__fs::filesystem::path const&amp;, std::__1::error_code*)'
  prog.cc:(.text+0xad): undefined reference to `std::__1::__fs::filesystem::__create_directory(std::__1::__fs::filesystem::path const&amp;, std::__1::error_code*)'
  prog.cc:(.text+0x12f): undefined reference to `std::__1::__fs::filesystem::__create_directory(std::__1::__fs::filesystem::path const&amp;, std::__1::__fs::filesystem::path const&amp;, std::__1::error_code*)'
  prog.cc:(.text+0x1b5): undefined reference to `std::__1::__fs::filesystem::__remove_all(std::__1::__fs::filesystem::path const&amp;, std::__1::error_code*)'
  clang-8: error: linker command failed with exit code 1 (use -v to see invocation)
  1
  </code></pre>
  
  <p>If I decomment the line with fs::permissions, I get this compile time error:</p>
  
  <pre><code>prog.cc:11:49: error: no member named 'remove_perms' in 'std::__1::__fs::filesystem::perms'
      fs::permissions("sandbox/1/2/b", fs::perms::remove_perms | fs::perms::others_all);
                                       ~~~~~~~~~~~^
  </code></pre>
  
  <p>I get similar errors from GCC.</p>
  
  <p>What am I doing wrong? Is it possible that these compilers support the C++17 language, but not its libraries in their entirety?</p>