Page 1 of 2 12 LastLast
Results 1 to 20 of 38

Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.


Thread: Compiling on iPhone 3.0

  1. #1
    Default Compiling on iPhone 3.0
    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 self...as 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.

    Thanks.

  2. #2
    What's Jailbreak?
    Join Date
    Jun 2009
    Posts
    4
    Thanks
    0
    Thanked 3 Times in 1 Post
    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.

  3. #3
    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

  4. #4
    What's Jailbreak?
    Join Date
    Jun 2009
    Posts
    4
    Thanks
    0
    Thanked 3 Times in 1 Post
    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.

  5. #5
    No updates on this topic anywhere on the web that I can find...how 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.

    Thanks.
    Last edited by deragun; 08-05-2009 at 03:14 PM.

  6. #6
    What's Jailbreak?
    Join Date
    Jun 2009
    Posts
    4
    Thanks
    0
    Thanked 3 Times in 1 Post
    Quote Originally Posted by deragun View Post
    No updates on this topic anywhere on the web that I can find...how 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.

    Thanks.
    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!

  7. #7
    what repository ?

  8. #8
    What's Jailbreak?
    Join Date
    Jun 2009
    Posts
    4
    Thanks
    0
    Thanked 3 Times in 1 Post
    Quote Originally Posted by Ecirb67 View Post
    what repository ?
    My bad- I downloaded it and installed it manually. I believe this is the url I found it:

    http://files.getdropbox.com/u/876743...honeos-arm.deb

    It was written by Ryan Petrich (Clippy author).

    Install with: dpkg -i fake-libgcc_1.0_iphoneos-arm.deb

  9. The Following 3 Users Say Thank You to JeremyGrieshop For This Useful Post:

    boopyman (03-31-2010), factro_ (09-20-2009), thekirbylover (09-07-2011)

  10. #9
    Default Cool Solution !!!
    Your r the man !!!
    thanks alot !!!!

  11. #10
    Default Easy Solution That Works Perfectly
    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!

  12. #11
    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

  13. #12
    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.

  14. #13
    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)

  15. #14
    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

  16. #15
    That thing posted above worked for me, thanks!

  17. #16
    >.< 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

  18. #17
    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; 10-18-2009 at 11:21 AM. Reason: Automerged Doublepost

  19. #18
    -_-

    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 Terminal.app 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 terminal.app 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 Terminal.app?

    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.

  20. #19
    I normally build from ssh, but I tried from Terminal.app to see what would happen. I get errors too. The problem is that with ssh I log in a root user, whereas with Terminal.app 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 Terminal.app, 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.

  21. #20
    AHA!!

    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; 10-19-2009 at 12:17 PM.

Page 1 of 2 12 LastLast
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •