命名空间“std"中没有名为“forward"的成员

2021-12-31 00:00:00 compiler-errors c++ xcode boost

在 XCode 中,我最近制作并测试了一个使用 boost 的处理库.我刚刚在 IDE 中设置了一个基本项目,进行了编码,它构建得很好.

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 项目是使用 3rd 方工具自动生成的.当我尝试在这个其他应用程序中包含我的基于 boost 的库时,我收到错误说明 ...

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 . . .

命名空间std"中没有名为forward"的成员

还有,行..

#include <tuple>

给出预处理器错误

'tuple' 文件未找到

看到原始库在我的机器上构建得很好,错误必须归结为构建设置的差异,但我看不到差异,也不知道比较 2 种不同构建设置的好方法项目.任何人都可以建议可能导致我出现问题的构建设置吗?

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??

在两个项目中,设置为

  • C/C++/Objective-C 编译器 = Apple LLVM 编译器 3.0

  • Compiler for C/C++/Objective-C = Apple LLVM Compiler 3.0

C++ 语言方言 = 编译器默认值

C++ Language dialect = Compiler default

C++ 标准库 = 编译器默认值

C++ Standard Library = Compiler default

编辑 2 [已解决]:

  • 我仍然在目标设置中启用了 C++11 方言.DoH!

推荐答案

您的项目编译为 C++11 并使用 C++11 标准库(std::forward 和标头是新的).原始项目似乎使用 C++03 标准库编译为 C++03,因此这些新功能不可用.

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.

相关文章