macOS Clang C++17 filesystem header not found
Libc++, which is the C++ standard library on OS X, has not moved <experimental/filesystem>
to <filesystem>
yet because the specification is not stable.
Hopefully <filesystem>
will be a part of the Clang 6.0 release. (We missed 5.0)
Xcode 11 Beta now includes <filesystem>
. Unlike the other answers indicating beta support in Xcode 10, Apple has mentioned this in the release notes.
Also mentioned in the release notes, is this is only supported by iOS 13, macOS 10.15, watchOS 6, and tvOS 13. You will only be able to use std::filesystem
for projects targeting these versions or later.
In reply to Max Raskin: I've installed Xcode 10 Beta 4, from July 17, 2018, and this version does not have "#include <experimental/filesystem>" or "#include <filesystem>".
The release notes also do not mention libc++17 <filesystem>. The release notes do mention that the following are in Xcode 10: <any>, <optional>, and <variant>.
Example include file location:
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/experimental