C++ iphone compiler troubles

Discussion in 'iOS Development' started by mbattiston, Aug 2, 2009.

  1. mbattiston

    mbattiston New Member

    Joined:
    Jul 31, 2009
    Messages:
    4
    Likes Received:
    0
    Device:
    iPhone 3G (Black)
    i have an iphone 3g with 3.0 firmware and after downloading icy I downloaded the C++ compiler but it wont compile. it basically seems like its missing the iostream header file.

    this is the error that i get:

    error: iostream: no such file or directory

    I also downloaded the toolchain 2.0 (i know its not 3 but i thought i would give it a go anyway) and when i tried to compile it said the same thing

    well confusing
    any one have any ideas?
  2. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    Tell it to include the headers from /var/include, which is where the toolchain package stores them for disk space reasons.

    Code:
    g++ -I/var/include program.cpp -o program
  3. Dr. Rambo

    Dr. Rambo Banned

    Joined:
    Jul 31, 2009
    Messages:
    93
    Likes Received:
    0
    Device:
    iPod touch
    I'm having a problem with the iPhone GCC, too. I can't get it to install from Cydia, it says it's missing the dependency "libgcc".
  4. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    That’s because libgcc isn't compatible with 3.0
  5. Dr. Rambo

    Dr. Rambo Banned

    Joined:
    Jul 31, 2009
    Messages:
    93
    Likes Received:
    0
    Device:
    iPod touch
    So there is no working compiler for the 3.0 firmware currently?

    And by that I mean a C/C++ compiler, not Obj-C.
  6. Cyanidepoison

    Cyanidepoison Active Member

    Joined:
    Jan 18, 2008
    Messages:
    1,076
    Likes Received:
    2
    Yes.

    Just build the toolchain on a desktop machine and build with that.
  7. iMario

    iMario Well-Known Member

    Joined:
    May 11, 2008
    Messages:
    1,642
    Likes Received:
    153
    Device:
    iPhone 5S
  8. Dr. Rambo

    Dr. Rambo Banned

    Joined:
    Jul 31, 2009
    Messages:
    93
    Likes Received:
    0
    Device:
    iPod touch
    So I can dpkg that deb, and then the GNU C Compiler should install correctly?
  9. iMario

    iMario Well-Known Member

    Joined:
    May 11, 2008
    Messages:
    1,642
    Likes Received:
    153
    Device:
    iPhone 5S
    Yep, that's right.
  10. Dr. Rambo

    Dr. Rambo Banned

    Joined:
    Jul 31, 2009
    Messages:
    93
    Likes Received:
    0
    Device:
    iPod touch
    Sweet, thank you!
    ------------------double post merged------------------
    So should this be able to compile simple C/C++ programs, and run them from the command line?

    Code:
    #include "stdio.h"
    
    int main()
    {
    printf("Hi");
    }
    
    That should work, no?

Share This Page