iPhone applications in c++ ?

Discussion in 'iOS Development' started by oioioi, Apr 18, 2008.

Thread Status:
Not open for further replies.
  1. oioioi

    oioioi New Member

    Joined:
    Apr 18, 2008
    Messages:
    102
    Likes Received:
    0
    How do people make a iPhone/iPod touch application in c++ on windows(not using iPhone SDK)? Can i just write a c++ program in Microsoft Visual C++ 2008 and SSH it into my iPod?
    Will this work?:
    If not, how did those people who made games and applications before iPhone SDK do it?
  2. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55


    No...the interface has to be an UIApplication, and the parts of the application, like the navigation bar( UINavigationBar ) are all parts of the UIKit. That would simply crash. PLUS, it would be an exe so it wouldn't even execute.




    EDIT: I use the cygwin binary toolchain to develop on installer. It uses Objective-C and is the main way to make applications...it takes a bit to learn and understand, but its worth it.
  3. oioioi

    oioioi New Member

    Joined:
    Apr 18, 2008
    Messages:
    102
    Likes Received:
    0
    Thanks a lot. Is there any way to use c++ to make games/applications for iPhone? Obj-C looks hard, and i dont want to learn two programming languages now
  4. SkylarEC

    SkylarEC Super Moderator Emeritus Staff Member

    Joined:
    Sep 19, 2007
    Messages:
    6,642
    Likes Received:
    129
    It's perfectly fine to program for the iPhone in C++. I believe NES.app uses quite a bit of it (for the eulator itself).

    What you have provided should work and will print "Hello World" in terminal. You can set up a GUI in C++, but it will be far easier using Objective-C (API access).
  5. thesmidge

    thesmidge New Member

    Joined:
    Nov 22, 2007
    Messages:
    865
    Likes Received:
    31
    Device:
    3G iPod touch
    Obj-C and C++ will both run perfectly on your iPod/iPhone. It's just that Obj-C is the native programming language for anything OS X, and all the iPhone runs is a watered down version of OS X.
  6. SkaterGOD/DOOD23

    SkaterGOD/DOOD23 New Member

    Joined:
    Dec 20, 2007
    Messages:
    686
    Likes Received:
    5
    Device:
    iPod touch
    Hmm... You would think, being both C based programming languages that it'd be easy to learn another one quickly if you already know one, right? Objective-C may just be hard because it's hard to get your hand on a good tutorial that will teach you it nowadays.
  7. Lazrhog

    Lazrhog New Member

    Joined:
    Nov 7, 2007
    Messages:
    614
    Likes Received:
    11
    Device:
    iPhone 3G (Black)
    yes you can use C++, but your makefile must include the right libraries or you will get linker errors.
  8. Virtualball

    Virtualball Well-Known Member

    Joined:
    Nov 23, 2007
    Messages:
    1,118
    Likes Received:
    63
    You CAN program in C++, don't let some of these people lie to you. It just won't have a GUI, as in, it will only be a CLI utility. Compile with this:

    arm-apple-darwin-g++ ./main.cpp -o main

    And then just launch from SSH or Term-vt100 and it should just display "Hello World!"
  9. Lazrhog

    Lazrhog New Member

    Joined:
    Nov 7, 2007
    Messages:
    614
    Likes Received:
    11
    Device:
    iPhone 3G (Black)
    true, but you can use a task scheduler from an Obj-C app that handles the view class, and screen pointer, and then use an entire c++ app as the main scheduled app if you want. BulletML for the Noiz2sa and rRootage ports I did are both C++
  10. oioioi

    oioioi New Member

    Joined:
    Apr 18, 2008
    Messages:
    102
    Likes Received:
    0
    What is "arm-apple-darwin-g++ ./main.cpp -o main"? I tryd to copy the project forlder to /Applications but there was no icon on my springboard.
    Does the input stream work on iPod?
    Is it possible to brick my iPod if there are any bugs in my code(bigger and more advanced code)?
Thread Status:
Not open for further replies.

Share This Page