I am using Microsoft Visual Studio 2019, and whenever I type std::filesystem
there's a red bar under "filesystem", with the messages
namespace "std" has no member "filesystem"
and
name followed by '::' must be a class or namespace name
when I don't have "::" in front of it and when I do respectively.
I have included filesystem so I don't see why it doesn't work.
I hope I provided enough information, if not just ask in the comments. if you can't help me with that, maybe you could help me find an alternative to std::filesystem::recursive_directory_iterator
.
The filesystem
library was added in C++17 and VS2019 starts in C++14 mode by default.
Project\<project name> Properties
Configuration Properties\General
C++ Standard
, select one of these:
/std:c++17
)/std:c++latest
)Then #include <filesystem>
and you should be good to go.