I'm trying to include <filesystem>
, but when I use a namespace, it shows this error:
std:: has no member "filesystem"
I know in older times it is <experimental/filesystem>
and namespace is std::experimental::filesystem;
but, when i does this, it also give error like that:
#error The <experimental/filesystem> header providing std::experimental::filesystem is deprecated by Microsoft \
and will be REMOVED. It is superseded by the C++17 <filesystem> header providing std::filesystem. \
You can define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING to acknowledge that you have received this warning.
I'm using Visual Studio 2019, and C/C++ language settings is set to latest version.
So what caused the problem?
Edit 1: all code which cause error:
#include <iostream>
#include <Windows.h>
#include <filesystem>
namespace fs = std::filesystem;
int main() {
return 0;
}
edit 2: All code, in older, which has error too:
#include <iostream>
#include <Windows.h>
#include <experimental/filesystem>
namespace fs = std::experimental::filesystem;
int main() {
return 0;
}
edit 3: Visual Studio 2019 project configuration settings -> general properties:
Platform Toolset: Visual Studio 2019 (v142) C++ Language Standart: ISO C++17 Standart (std::c++17) Windows SDK version 10.0 (Lastest installed version)