How to import a C++ library into a Xcode Objective

2019-07-16 05:20发布

问题:

I'm new to developing apps for OSX. I want to write a library that does a specific job in C++ and use it inside my XCode Objective-C/Objective-C++ project.

How should I compile and prepare the C++ library so it can be imported into XCode?

回答1:

There are Xcode templates for C++ libraries. Just make one of those and copy the library's source into it.



回答2:

You need to set Compile Sources As: Objective-C++ in your build settings.