0

Can we add C++ files into ios project? if so then what all the build settings we need to do? Is apple accepts C++ code inside ios project?

2
  • @VivekSehrawat - I need to do any settings in the xcode. or simply it runs? Commented Oct 3, 2013 at 6:31
  • stackoverflow.com/questions/12389102/… Commented Oct 3, 2013 at 7:06

3 Answers 3

3

You don't need to do anything special. Just add the files to the project, as long as they have a .cpp or .cxx extension they will compile fine.

If you want to use C++ objects in Objective-C code you need to compile in "Objective-C++" mode, do this by naming your implementation files .mm instead of .m, then you can use C++ objcets inside your Objective-C classes and methods.

Sign up to request clarification or add additional context in comments.

Comments

1

@Cintu : You can add C++ files in X-Code like this.

Since Objective-C is a extension/Super-set of C.enter image description here

Comments

0

Yes, you can use c++ files inside ios project. And, Yes Apple accepts your app, unless it uses private frameworks.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.