I just renamed one Objective-C class implementation file in a static library / framework from .m to .mm and then linking fails with this error:
Undefined symbols for architecture armv7s: "___gxx_personality_sj0"
I can resolve it by adding -lc++
(libc++.dylib) to other linker flags of the app's target. But my question really is: why does it fail? Why does this issue appear only in static library code, but not when renaming one of the app's implementation files?
And are there any other solutions besides adding -lc++
?
Note: the implementation of the class contains no code whatsoever. There's no use or import of C++ code in this class either, nor is C++ code used anywhere else in the project.