添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Hello, I'm building a C++17 codebase on my Pi 4. Everything has gone well, except that when I try to use std::filesystem::exists(), I get linker errors. I imagine it's some combination of upgrading g++, switching to clang, or updating my libc++/libstdc++. I've experimented already with installing clang, but switching to libc++ seems to cause other problems for existing libraries. Any ideas?
Aaron
If you want to use std::filesystem, you have to manually link to stdc++fs: https://gcc.gnu.org/onlinedocs/libstdc+ ... using.html
For example:

Code: Select all

g++ -std=c++17 -lstdc++fs file.cpp
Pieter