how to use std::filesystem on gcc 8?

Add the filesystem library as an argument to your compiler that will be forwarded to the linker. Also make sure you are using C++17. Both g++ and clang++ accepts this particular format:

--std=c++17 -lstdc++fs

Leave a Comment