Xcode 10.2 现在包含<filesystem>
标头。但是,在使用 编写代码时std::filesystem
,我遇到了很多额外的链接错误。
Undefined symbols for architecture x86_64:
"std::__1::__fs::filesystem::path::__filename() const", referenced from:
std::__1::__fs::filesystem::path::filename() const in dump_zip.cpp.o
std::__1::__fs::filesystem::path::filename() const in libxp_parse.a(zipped.cpp.o)
std::__1::__fs::filesystem::path::remove_filename() in libxp_parse.a(zipped.cpp.o)
std::__1::__fs::filesystem::path::has_filename() const in libxp_parse.a(zipped.cpp.o)
std::__1::__fs::filesystem::path::has_filename() const in libxp_parse.a(acf.cpp.o)
我相信需要链接一个额外的库来支持文件系统,但我无法确定它是什么或在哪里。知道它叫什么吗?
编辑:libc++ 说这libc++fs
是必需的——但是,这似乎没有随 Xcode 一起分发,至少不在默认搜索目录中。