User Tag List

  1. deragun's Avatar
    Hello, I hope someone can help me out here. I was in the middle of developing an application on my iPhone before upgrading to 3.0. I followed the general setup given by this example:

    Developing for the iphone using the open toolchain and SDK 2.0 headers - antirez weblog

    Thus I was actually compiling the code on the phone its this seemed like the easiest option for someone who doesn't own a mac. Now when I try to make my app I get:

    /bin/sh: arm-apple-darwin9-gcc: command not found

    When I look on Cydia, I can only find "GNU C Compiler" but when I try to install this it shows a depends on libgcc which it can't find (and neither can I when searching for it). Due to this it won't install.

    Does anyone have any help to offer? Basic gist is that I want as easy of a way as possible to compile my appliation for my iPhone now that it's running 3.0. I'd prefer to get it working again to compile on the phone it's self, but if I have to switch to somehow compiling on my windows PC I will.

    2009-06-29 05:50 PM
  2. JeremyGrieshop's Avatar
    I have the exact same problem. It appears that libgcc is still not available for 3.0 yet. I've contacted several people to inquire about it, but have not heard a response.

    It seems that you and I are one of a handful of people in this world that actually use iphone-gcc rather than cross-compiling.
    2009-06-29 07:18 PM
  3. Ecirb67's Avatar
    I had the same problem, I just downloaded the libgcc in this website : Section System - iPod Touch ?????? ????????! and now I can install GCC in Cydia
    2009-06-30 10:25 PM
  4. JeremyGrieshop's Avatar
    Thanks for the tip! It worked, I was able to install iphone-gcc and after fighting some header file confusion, I was able to re-compile my project. Unfortunately:

    /usr/bin/ld: /usr/lib/libSystem.dylib unknown flags (type) of section 4 (__TEXT,__dof_magmalloc) in load command 0
    /usr/bin/ld: /usr/lib/libstdc++.6.dylib unknown flags (type) of section 4 (__TEXT,__dof_cxa_runti) in load command 0
    /usr/bin/ld: /usr/lib/libSystem.B.dylib unknown flags (type) of section 4 (__TEXT,__dof_magmalloc) in load command 0
    /usr/bin/ld: /System/Library/PrivateFrameworks/JavaScriptCore.framework/JavaScriptCore unknown flags (type) of section 4 (__TEXT,__dof_JavaScrip) in load command 0
    /usr/bin/ld: /System/Library/Frameworks/CoreAudio.framework/CoreAudio unknown flags (type) of section 4 (__TEXT,__dof_AudioHAL_) in load command 0
    collect2: ld returned 1 exit status

    It appears to be some linking issues still. Even "hello world" will not build. I'm guessing that libgcc does need to be updated and perhaps it was left off on purpose.
    2009-07-01 09:58 PM
  5. deragun's Avatar
    No updates on this topic anywhere on the web that I can is everyone developing on Windows for jailbroken iphones on 3.0? I'd love to be able to get back to finishing up my XBMC remote app.

    Last edited by deragun; 2009-08-05 at 09:14 PM.
    2009-08-05 09:12 PM
  6. JeremyGrieshop's Avatar
    No updates on this topic anywhere on the web that I can is everyone developing on Windows for jailbroken iphones on 3.0? I'd love to be able to get back to finishing up my XBMC remote app.

    I got iphone-gcc to work for 3.0. Grab "fake-libgcc" from Cydia. It will provide the necessary pre-req's for iphone-gcc. My old apps now compile and link great!
    2009-08-05 09:41 PM
  7. Ecirb67's Avatar
    what repository ?
    2009-08-06 11:06 AM
  8. JeremyGrieshop's Avatar
    what repository ?
    My bad- I downloaded it and installed it manually. I believe this is the url I found it:

    It was written by Ryan Petrich (Clippy author).

    Install with: dpkg -i fake-libgcc_1.0_iphoneos-arm.deb
    2009-08-06 03:06 PM
  9. shtofff's Avatar
    Your r the man !!!
    thanks alot !!!!
    2009-08-11 04:24 PM
  10. deragun's Avatar
    I tried this solution last night, and after less than 15 min, I was up and running. Flawless.

    So, for anyone else trying to figure out how to build on the iphone again, this is your solution right here.

    Thanks a ton JeremyGrieshop!
    2009-08-24 01:43 PM
  11. mystikum's Avatar
    I dpkg the fake-libgcc on the iphone and now when I try to compile a simple hello world program I am getting an error that "stdio.h is not found" same thing with c++ but instead it is complaining about iostream
    2009-09-09 09:12 PM
  12. kestl's Avatar
    I'm having the exact same problem as mystikum on a clean restored and jailbroken ipod touch 1G.

    Seems like this is a matter of a that could be solved by a symlink, where is gcc and g++ looking for these libraries, and where are they installed by fake-libgcc? If we can find these two locations then we can just link them.
    2009-09-29 06:39 PM
  13. rpetrich's Avatar
    fake-libgcc just sets up some symlinks and enables apt to install iphone-gcc; to actually compile you will need headers (which you have to provide yourself)
    2009-09-30 06:38 PM
  14. kestl's Avatar
    Thanks petrich, could you tell me where I could get the header files and what to do with them or point me to a link on how to do this. I'm a linux user I've never had to manually configure gcc before, it's just always there o_0
    2009-09-30 07:08 PM
  15. Luigi453's Avatar
    That thing posted above worked for me, thanks!
    2009-10-01 03:29 AM
  16. kestl's Avatar
    >.< glad everyone else is having so much luck, all I've done is install the compiler and fake-libgcc (none of the c++ stuff) and it's still not able to find stdio.h. I've been looking for the directory that the header files need to be in to make sure there's at least a symlink but I can't find where they're supposed to be. Any help would be great :-D
    2009-10-04 10:33 PM
  17. JeremyG's Avatar
    For the headers, following the directions on Developing for the iphone using the open toolchain and SDK 2.0 headers - antirez weblog, get the headers from MEGAUPLOAD - The leading online storage and file delivery service. Extract them on your phone, and copy the contents into /usr/include, or some other location in the include path. It should then be able to find stdio.h.

    Another thing to note, in case anyone is having problems like I did, is that you have to sign the application in order for it to run. Otherwise you will get 'Killed' written to stderr every time you try to run your app. To run it, build your program first (i.e. gcc main.c -o testApp), then do:
    $> ldid -S ./testApp
    Last edited by JeremyG; 2009-10-18 at 05:21 PM. Reason: Automerged Doublepost
    2009-10-18 05:21 PM
  18. kestl's Avatar

    Thanks for the help Jeremy, I'm having an error I can't explain now though. I tried building a 6 line hello world app from the using 'gcc -o test test.c'. I got about 50 lines of errors, the compiler was actually declaring that there were errors within stdio.h

    So I wanted to get a copy of the error so I could paste it here, and when I ssh'd into my ipod and ran the exact same command, the program built, then ran without needing to be signed. I can't imagine what is different, ssh should behave exactly like using the terminal from the ipod, but sure as hell it's giving me errors from and building fine from ssh.

    -_- is all I can say right now. Can anyone think of any reason at all that ssh would produce different results than

    I'm trying to figure out how to copy the errors over, but like I said it's mostly 'finding' errors in stdio.h itself. Actually, I just looked again and the only error that is actually in my program is 'test.c:6: error: expected '{' at end of input' which quite simply doesn't make any damn sense. It's on the same line as my closing brace. Blah to this mess, I can't imagine what's wrong I recently restored less than a month ago its a pretty fresh install.
    2009-10-19 05:58 AM
  19. JeremyG's Avatar
    I normally build from ssh, but I tried from to see what would happen. I get errors too. The problem is that with ssh I log in a root user, whereas with I am logged on as 'mobile', which does not have root access, and so apparently does not have access to the include directories on my system. So, if it's important that you can build in, either change permissions of the files, change your /etc/group file to give mobile user admin, or login with root with su. Glad you were able to build your app though.
    2009-10-19 06:23 AM
  20. kestl's Avatar

    I didn't even think about the fact that I was logging in as root. Awesome. Finally got it to build, thanks so much for the help man, now I can code whenever I get a good idea, and I've got an iTouch so when I don't have internet I have a new toy to play with too.

    Did you have any problems compiling c++? It's not finding any of the headers either, and I'm root this time I installed the 'iPhone OS C/C++ compiler' and 'C++ Standard Library' packages from Cydia but still getting the same problem, and the article you posted doesn't have anything about C++. I'm gonna mess with putting the headers in different places and see if g++ can find them, I'll post if I have any success.
    Last edited by kestl; 2009-10-19 at 06:17 PM.
    2009-10-19 06:00 PM
38 12