No type named 'shared_ptr' in namespace 'std'

Hope this helps someone else

Trying to compile an iOS project with Cedar BDD continued to fail without a type named "shared_ptr" in the error message "std" in the namespace. Obviously, this was a C ++ bug, but could not understand why the C ++ Xcode library used didn; t is of type shared_ptr, defined until I find that the target build settings provide two libraries to choose from

  • libstdc ++ (default compiler)
  • Lib ++
+4
source share
3 answers

Choosing libC ++ fixes the problem, see screenshot Xcode 4.4 build settings window

+7
source

Apple is shipping an old version of libstdc ++ very that does not support C ++ 11, so if you use libstdc ++ you cannot use the power of C ++ 11.

+3
source

In xcode you must use #include <memory> , you cannot use #include <memory.h> . Please check it.

0
source

Source: https://habr.com/ru/post/1438894/


All Articles