VS2017: E0135 namespace “std” has no member “filesystem”

℡╲_俬逩灬. 提交于 2019-12-21 06:49:49

问题


In order to use: std::filesystem from the C++17 library, my project was migrated from vs2015 to vs2017.

My project compiles and runs without error, the lib is included without error, but when trying to use std::filesystem I get the following:

It seems the library is not being included but cant see why not?

Edit:

Microsoft Visual Studio Enterprise 2017

VisualStudio.15.Release/15.7.3+27703.2026

Visual C++ 2017 00369-90000-00000-AA466

Microsoft Visual C++ 2017


回答1:


A couple of options to investigate.

  • Check the language standard. You need C++17 or above:
  • If your version of visual studio doesn't support std::filesystem yet, you can try std::experimental::filesystem.

I have the following version and std::filesystem works (with the C++17 language selection shown above):

Microsoft Visual Studio Community 2017 Preview
Version 15.8.0 Preview 1.1
VisualStudio.15.Preview/15.8.0-pre.1.1+27705.2000


来源:https://stackoverflow.com/questions/50668814/vs2017-e0135-namespace-std-has-no-member-filesystem

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!