Link errors using <filesystem> members in C++17
问题 I'm using gcc 7.2 on Ubuntu 16.04, and I need to use the new filesystem library from C++17. Even though there is indeed a library called experimental/filesystem, I can't use any of its members. For example, when I try to compile this file: #include <iostream> #include <string> #include <experimental/filesystem> using namespace std; namespace fs = std::experimental::filesystem::v1; int main(){ fs::path p1 = "/usr/share/"; } I get a compilation error which looks like this: $ g++-7 test.cpp -std