I noticed that linking my CMake project with gcc 8.3 fails to link functions from std::filesystem. This is not the case with gcc 9, clang 7 or clang 8.
I found solutions like this and this, but these hard-code the linking of stdc++fs
, which is normally not what you want to do.
- So what is the correct way to link such libraries?
- Do I have to do a
find_package
? What would be the package I am looking for?