Hello Guys, In this article we are going to see solution for iOS error No type named 'terminate_handler' in namespace 'std'
.
1. Error Description:
If you’re seeing this error during compilation in xCode:
No type named 'terminate_handler' in namespace 'std'
it usually means the compiler cannot find a definition for std::terminate_handler
. This typically occurs in C++ or Objective-C++ environments when working with exception handling.
2. Common Causes:
-
Missing required C++ standard headers (like
<exception>
). -
Mixing C++ code in
.m
files instead of using.mm
(Objective-C++). -
Using an older or incorrect C++ standard version.
-
Incorrect configuration in Xcode or build scripts.
3. Error Solutions:
- Include
<exception>
Add the following header at the top of your source file:
#include <exception>
This error is generally caused by a missing C++ header or incorrect compiler setup. Adding #include <exception>
and ensuring .mm
file usage usually resolves the problem quickly.
After building iOS project you may face following error
Missing '#include <sys/_types/_ucontext64.h>'; 'ucontext64_t' must be declared before it is used
If you face this error then check this article for solution.
Thank you and let me know if you still facing issue.