Results 1 to 3 of 3

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


Thread: IOKit Compiler Issues

  1. #1
    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
    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
    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 05: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
  •