I'm having troubles to link the filesystem library on C++. I have gcc 8.2.0:
#include<iostream>
#include <string>
#include <filesystem>
namespace fs = std::filesystem;
int main(int argc, char** argv){
std::string path = "/";
for (auto & p : fs::directory_iterator(path))
std::cout << p << std::endl;
}
Here is my makefile:
CC= g++-8.2.0
CFLAGS= -Iheaders -std=c++17 -Wall
all: lsr
lsr: lsr.o
${CC} ${CFLAGS} $? -o $@
%.o: %.cpp
${CC} ${CFLAGS} -c $<
clean:
rm -f *.o lsr
gcc (Gentoo 8.2.0-r3 p1.4) 8.2.0
How can I fix it? :S