本文介绍了用Xcode 9链接std :: experimental :: filesystem的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am using std::experimental::filesystem with Xcode 9.0 beta. The compiler phase completes OK but the linker complains of undefined symbols:

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(),但是链接程序并没有抱怨它丢失了.

I am also using std::experimental::filesystem::canonical(), but the linker isn't complaining about that being missing.

如何配置项目以包括这些缺少的参考?

How can I configure the project to include these missing references?

更新:

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

I have been experimenting with a simpler program. If I just use canonical() then the linker complains that it is missing.

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

I can use std::experimental::optional - everything compiles, links and runs OK. But 'optional' is a template and so probably doesn't involve a library.

推荐答案

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

Are you compiling with any -std= option ("C++ Language Dialect" option in Xcode)?

这篇关于用Xcode 9链接std :: experimental :: filesystem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 13:13