How should I get Xcode to link an iOS project that uses a C++ static library
        Posted  
        
            by 
                user1681572
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by user1681572
        
        
        
        Published on 2012-10-29T21:32:42Z
        Indexed on 
            2012/10/29
            23:01 UTC
        
        
        Read the original article
        Hit count: 218
        
xcode
Using Xcode, I've written a Cocoa Touch static library, mainly in C++. It exposes a C interface for the benefit of Objective-C client code.
I have a client iOS app that uses it, and everything works and runs as expected, except that I found I needed to include a minimal .cpp file in the client project to get the link to succeed. Otherwise I get C++-related unresolved symbols, e.g. operator new(unsigned long).
The above hack is easy and effective, and so I guess I'm not breaking any laws, but is there a proper way to eliminate my linker errors?
© Stack Overflow or respective owner