Problem with compiling <experimental/filesystem>

已回答

I must implement filesystem for my project. So, I include <experimental/filesystem> (because for some reason I cant include only filesystem). Auto-detected compiler is c++ in my settings. When I input some easy code for test I got error for not referenced function std::experimental::filesystem::create_directory .... Any help?

0

Hello! 

1. What compiler (name and version) do you use? 

2. Do you get errors for #include <experimental/filesystem>?

3. Please provide a screenshot of the error you get for your code.

0
Avatar
Permanently deleted user

1) Clion detect c++ (v7.4.0). When I pick gcc(v.8.3.0) I got same error and there is couple errors in <iosteam>

2) I got "non defined reference" error to experimental/filesystem. Also, I am using C++17, I have filesystem.h library in usr/.../8/ path but I cant include only <filesystem> .

3) 

0

Please add

target_link_libraries(testClion stdc++fs)

after the line with add_executable() in the CMakeLists.txt and reload the project (Tools | CMake | Reset Cache and Reload Project).

1

请先登录再写评论。