Because I'm a novice to all things C++ and gcc related I need to understand something that's potentially critical. If I use .mm files in a new iphone project whose output is a static lib I get this error:
"___gxx_personality_v0", referenced from:
If I change the C++ Standard Library type from Dynamic (the default) to static the error goes away. Is this a limitation of the SDK? Can Obj-C++ extensions NOT be enabled in a dynamic library? Keep in mind that I'm a novice and I only pretend to know what I'm talking about here. I also want to know the difference between these settings and if changing them has a potentially negative impact. Is my assumption correct in that a dynamic library is loaded at runtime while a static library is linked into the final binary at build time? If this is so, then why would the iPhone SDK allow the building of a dynamic library? You can't install 3rd party libs on the iPhone to date and have them shared between apps.
Update A couple people have responded and I appreciate the answers. However I wish to clarify something that appears misunderstood from my original question. Switching the file type from ".m" to ".mm" is not the answer, rather it's what triggered the exception. The situation is this, develop a static lib for iPhone that uses Obj-C++ files with ".mm" extension. Then use this library in an iPhone application (or unit test suite). Unless the client target is switched to use "static" instead of the default "dynamic" for the Std C++ library type you will see this error. I originally thought I may have been introducing a subtle error by changing this setting but I'm now trying to get an understanding of the difference and why the default is set in a way that seems opposite of its typical use case.