Roman
Roman

Reputation: 10403

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

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?

Upvotes: 2

Views: 1154

Answers (2)

mskw
mskw

Reputation: 10308

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

Upvotes: 0

bames53
bames53

Reputation: 88155

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

Upvotes: 1

Related Questions