Upgrade gcc version in Ubuntu 18,04
Solution 1:
filesystem
is experimental in g++-7.5.0.
You should still be able to use it by including it as <experimental/filesystem>
(which provides namespace std::experimental::filesystem
), and linking libstdc++fs
explicitly (with -lstdc++fs
on the g++ command line), as described in Filesystem in C++17
Alternatively, you can install g++-9
(or even gcc-10
) in bionic from the toolchain-r PPA.