+ Reply
Results 1 to 3 of 3

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


Thread: IOKit Compiler Issues

is a discussion within the

iPhone / iPod Touch SDK | Development Discussion

forums, a part of the

3rd Party Apps For iPhone | iPod Touch

section;
Every IOKit application I try to compile gives me an error similar to the following: Code: $ make arm-apple-darwin-gcc -c main.m -o main.o arm-apple-darwin-gcc -c GravApplication.m -o GravApplication.o arm-apple-darwin-gcc -lobjc
...
  1. #1
    What's Jailbreak? MikeTV's Avatar
    Join Date
    Aug 2007
    Posts
    18
    Thanks
    2
    Thanked 4 Times in 4 Posts

    Default IOKit Compiler Issues
    Every IOKit application I try to compile gives me an error similar to the following:

    Code:
    $ make
    arm-apple-darwin-gcc -c   main.m -o main.o
    arm-apple-darwin-gcc -c   GravApplication.m -o GravApplication.o
    arm-apple-darwin-gcc -lobjc -framework CoreFoundation -framework CoreGraphics -framework GraphicsServices -framework Foundation -framework IOKit -framework UIKit -framework LayerKit -o Grav main.o GravApplication.o
    /usr/local/bin/arm-apple-darwin-ld: /usr/local/share/iphone-filesystem/System/Library/Frameworks/IOKit.framework/IOKit bad magic number (not a Mach-O file)
    collect2: ld returned 1 exit status
    make: *** [Grav] Error 1
    I found the above application at the end of THIS POST
    Examined the code, and it appears to be bug-free.
    This error appears to occur only when I include the -framework IOKit flag in the linker options.
    What can I do to fix this?

    Environment = WinXP/Cygwin
    Toolchain = winChain/preBuildToolchain

  2. #2
    JLA
    JLA is offline
    Developer
    Join Date
    Oct 2007
    Posts
    224
    Thanks
    1
    Thanked 31 Times in 24 Posts

    I'm not sure what's wrong, and maybe someone has a simple solution for this. But in the meantime, you might want to try this:

    In your iPhone filesystem (on your home computer), go to the /System/Library/Frameworks/IOKit.framework directory.
    Type: arm-apple-darwin-otool -h IOKit
    If it says it's not the right type of file, then perhaps you should try recopying the directory from your iPhone.

    Do you remember what version of the firmware you had when you originally installed the toolchain?

  3. #3
    What's Jailbreak? MikeTV's Avatar
    Join Date
    Aug 2007
    Posts
    18
    Thanks
    2
    Thanked 4 Times in 4 Posts

    Thank you for your reply.

    Code:
    Mike@miketv /usr/local/share/iphone-filesystem/system/library/Frameworks/IOKit.framework
    $ arm-apple-darwin-otool -h IOKit
    IOKit: is not an object file
    I don't have a manually installed toolchain. I used winChain to install it, and if i'm not mistaken, the author bundled 1.1.1 inside the preBuildToolchain (needed by winChain), so there shouldn't be any conflicts compiling IOKit applications... Should there?

    I suppose I could try the installation method explained here...

    After a quick reinstall of the toolchain using the method explained @ iphonegameover, I got this:

    Code:
    Mike@miketv /usr/local/arm-apple-darwin/filesystem/System/Library/Frameworks/IOKit.framework
    $ arm-apple-darwin-otool -h IOKit
    IOKit:
    Mach header
          magic cputype cpusubtype   filetype ncmds sizeofcmds      flags
     0xfeedface      12          6          6    13       1608 0x000000b5
    Guess that did the trick. Thank you for your help.
    Last edited by MikeTV; 01-31-2008 at 04:44 PM. Reason: Automerged Doublepost

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts