Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

c++ - No member named 'forward' in namespace 'std'

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.

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

No member named 'forward' in namespace 'std'

and also, the line . .

#include <tuple>

gives the preprocessor error

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

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

EDIT 2 [solved]:

  • I still had C++11 dialect enabled in the Target settings. DoH!
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...