Having troubles accessing the filesystem namespace -
Problem:
- "Symbol 'filesystem' could not be resolved"`
Leading Research:
How can I get the list of files in a directory using C or C++? - Stack Overflow
C++17 Filesystem - Codingame
Setup:
GCC/G++: 9.2.0
C++: C++17
Demo:
#include <iostream>
#include <filesystem>
using namespace std;
namespace fs = std::filesystem;
int main(void) {
return 0;
}
I have tried the std::experimental variant to no success. How can I get C++17 & the <filesystem>
API working?
Soln Update:
Thank you P Kramer, w/MSYS2 I was able to quickly come to solution.
Procedure:
- Get MSYS2 (msys2-x86_64-20210725.exe)
- Run the installer (@loc C:\Sw\msys64)
- pacman -Syu
- pacman -Su
- pacman -S --needed base-devel mingw-w64-x86_64-toolchain
- Check w/cmd (C:\Sw\msys64\mingw64\bin)
- gcc -v (GCC v10.3.0)
- Add to path (C:\Sw\msys64\mingw64\bin, C:\Sw\msys64\usr\bin)
- Restart Eclipse
- Demo compile to confirm C++17 (__cplusplus == 201703L)
- Use it!