将std :: experimental :: filesystem与Xcode 9连接起来

use*_*478 6 macos xcode c++17

我正在使用带有Xcode 9.0 beta的std :: experimental :: filesystem.编译器阶段完成正常,但链接器抱怨未定义的符号:

std::experimental::filesystem::v1::path::__filename() const
std::experimental::filesystem::v1::path::__filename() const
std::experimental::filesystem::v1::path::__stem() const
std::experimental::filesystem::v1::__status(std::experimental::filesystem::v1::path const&, std::__1::error_code*)
Run Code Online (Sandbox Code Playgroud)

我也在使用std :: experimental :: filesystem :: canonical(),但是链接器并没有抱怨丢失它.

如何配置项目以包含这些缺少的引用?

更新:

我一直在尝试一个更简单的程序.如果我只使用canonical(),那么链接器会抱怨它丢失了.

我可以使用std :: experimental :: optional - 一切都编译,链接并运行OK.但"可选"是一个模板,因此可能不涉及库.

Bre*_*nks 1

您是否使用任何-std=选项(Xcode 中的“C++ Language Dialect”选项)进行编译?

  • 我尝试了 C++17 方言和不同的库选项。都没有解决问题。 (3认同)