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

人走茶凉 提交于 2019-12-11 00:46:30

问题


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.



来源:https://stackoverflow.com/questions/8894084/how-to-import-a-c-library-into-a-xcode-objective-c-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!