Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k 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 Reply

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.8k users

...