Ben Flynn Ben Flynn - 8 months ago 70
C++ Question

Why do I need to add -lstdc++ to my Other Linker Flags?

An answer to this question made me realize that I need to add -lstdc++ to my "Other Linker Flags" to get my project to compile.

If I compile my code directly into my project, it runs fine. If I build it into a framework and include that framework, it complains:

Undefined symbols for architecture armv7:
"std::terminate()", referenced from: ...

Adding -lstdc++ seems to solve the problem. It's great that it works, but can someone help me understand why I only see this issue when treating my code as framework?

Answer Source

Jerry Coffin's comment was the helpful answer. The compiler was detecting the .mm extension and switching to Obj-C++ for the framework build, but had no indication that the build including the framework should also be compiled this way.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download