xcode 命名空间“std”中没有名为“forward”的成员
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10948355/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
No member named 'forward' in namespace 'std'
提问by learnvst
In XCode, I recently made and tested a processing library that uses boost. I just set up a basic project in the IDE, coded away, and it builds fine.
在 XCode 中,我最近制作并测试了一个使用 boost 的处理库。我只是在 IDE 中设置了一个基本项目,进行了编码,它构建得很好。
I now want to use that library in another application. The other application's xcode project was automatically made using a 3rd party tool. When I try to include my boost-based library in this other application, I get errors stating . . .
我现在想在另一个应用程序中使用该库。另一个应用程序的 xcode 项目是使用 3rd 方工具自动生成的。当我尝试在这个其他应用程序中包含我的基于 boost 的库时,我收到错误说明 . . .
No member named 'forward' in namespace 'std'
No member named 'forward' in namespace 'std'
and also, the line . .
还有,线。.
#include <tuple>
gives the preprocessor error
给出预处理器错误
'tuple' file not found
'tuple' file not found
Seeing as the original library builds just fine on my machine, the errors must be down to a difference in the build settings, but I cannot see the difference and do not know of a good way to compare the build settings of 2 different projects. Can anyone suggest the build setting that might be causing me the problem??
看到原始库在我的机器上构建得很好,错误必须归结为构建设置的差异,但我看不到差异,也不知道比较 2 个不同项目的构建设置的好方法。任何人都可以建议可能导致我出现问题的构建设置吗?
EDIT:
编辑:
In both projects, the setting for
在这两个项目中,设置为
Compiler for C/C++/Objective-C = Apple LLVM Compiler 3.0
C++ Language dialect = Compiler default
C++ Standard Library = Compiler default
C/C++/Objective-C 编译器 = Apple LLVM 编译器 3.0
C++ 语言方言 = 编译器默认值
C++ 标准库 = 编译器默认值
EDIT 2 [solved]:
编辑 2 [已解决]:
- I still had C++11 dialect enabled in the Target settings. DoH!
- 我仍然在目标设置中启用了 C++11 方言。啊!
回答by Sebastian Redl
Your project compiles as C++11 and is using a C++11 standard library (std::forward and the header are new). The original project appears to compile as C++03 with a C++03 standard library, so those new features are not available.
您的项目编译为 C++11 并使用 C++11 标准库(std::forward 和标头是新的)。原始项目似乎使用 C++03 标准库编译为 C++03,因此这些新功能不可用。