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

时间:2017-06-21 16:36:49

标签: xcode macos 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*)

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

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

更新:

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

我可以使用std :: experimental :: optional - 一切都编译,链接并运行正常。但是'可选'是一个模板,因此可能不涉及图书馆。

1 个答案:

答案 0 :(得分:1)

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