how to use std::filesystem on gcc 8?

前端 未结 3 1359
挽巷
挽巷 2020-12-11 02:29

I have updated version of gcc, gcc --version produces the following output

    gcc (Ubuntu 8.1.0-5ubuntu1~16.04) 8.1.0
Copyright (C) 2018 Free Software Found         


        
3条回答
  •  既然无缘
    2020-12-11 03:33

    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
    

提交回复
热议问题