Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.
Thread: IOKit Compiler Issues
01-31-2008, 12:54 AM #1IOKit Compiler Issues
Every IOKit application I try to compile gives me an error similar to the following:
$ 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
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
01-31-2008, 01:12 AM #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?
01-31-2008, 04:44 PM #3
Thank you for your reply.
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 suppose I could try the installation method explained here...
After a quick reinstall of the toolchain using the method explained @ iphonegameover, I got this:
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
Last edited by MikeTV; 01-31-2008 at 04:44 PM. Reason: Automerged Doublepost