C++17 cannot include <filesystem>
Answered
I'm using latest CLion version with LLVM on OSX. I'm trying to play with new features of C++17 and one of the features I see is filesystem header file.
I'm trying to include it like this
#include<filesystem>
namespace std = std::filesystem;
But the compiler is complaining the "file is not found". In my CMakeLists.txt I have :
cmake_minimum_required(VERSION 3.9)
project(testrunner)
set(CMAKE_CXX_STANDARD 17)
add_executable(testrunner main.cpp)
And I did select C++17 project on the begging. What am I doing wrong? Is there any special flag or option to enable the syntax highlighting and compilation?
Thank you for your help.
Please sign in to leave a comment.
@Psam Dev for gcc this works in the following way for now:
It looks like for clang it hasn't been supported yet: https://libcxx.llvm.org/cxx1z_status.html
Thanks, works. To be sure others don't struggle with the same triviality I did: mind in uses within code itself, subsequently must also use "experimental::filesystem::" instead of "filesystem::" ;-)