iPhone and C++

Will any application I write in C++ work on the iPhone? Or only if I use C++ standard libraries?

I have no idea about iPhones and the like and have read around and failed to find a concise answer to these questions.
you need objective-c.. however look into toolchain (i think thats what its called). It is a jailbreak compiler tool that i believe allows c++
That seems to contradict this:

"Applications must be originally written in Objective-C, C, C++, or JavaScript as executed by the iPhone OS WebKit engine, and only code written in C, C++, and Objective-C may compile and directly link against the Documented APIs "

Although, perhaps that info is unreliable. I will look into jailbreaker.

http://code.google.com/p/iphone-gcc/

look at that.. again that is only for jailbreak apps, you wont be able to put it on appstore, only cydia.
Last edited on
Hi, I am an iOS developer.

You can use C/C++/Obj-C or any combination of the 3 in order to create iOS apps. Obj-C will compile C/C++ natively, but their are a few "caveats" when mixing them. But here is the kicker, the native framework for working with iOS is Obj-c, so you do have to use "some" Obj-C in order to interface with the OS. But once you create that interface layer, EVERYTHING else can be written in any of the above 3 languages. Also, unlike Android, STL and all other "standard" C++ libs are available, and baked right in.

Hope that answers your question.
digitalsynapses: can you write c++ on the iphone? is there say an xcode app?
can you write c++ for the iphone to write c++ on the iphone to write c++ for the iphone?????
There's probably one way or another to do this, but the easiest thing would probably be to just learn Objective-C. It's pretty similar to C(++), so it shouldn't be too hard/time consuming to learn.
Last edited on
The thing with iOS development is the cost basically. Without delving into the language it uses, look at the up-front and recurring cost you need to fork out. You need a Mac (generally cost more than Windows PC), iOS SDK (is this free?), to list your app on their app store you pay a recurring annual fee of US$99. Total up these cost and it will stop most poor developers at the door :)

PS Now you know why Apple is so rich :)
Topic archived. No new replies allowed.