views:

260

answers:

1

Hello,

I am trying to link to the Kernel framework as a 3rd party library is using functions from the I/O Kit library (http://developer.apple.com/mac/library/documentation/Darwin/Reference/KernelIOKitFramework/index.html).

I am new to development on MacX, I am on Snow Leopard and I compile with the -m32 flag.

g++-4.2 -headerpad_max_install_names -m32 -F/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/ -F/System/Library/Frameworks/ -o myApp debug/main.o -F/Library/Frameworks -L/Library/Frameworks -framework OpenCL -framework CoreAudio -framework Kernel -framework QtGui -framework Carbon -framework AppKit -framework QtCore -lz -lm -framework ApplicationServices

I get the following error:

ld: framework not found Kernel

I am sure that the Kernel framework is in the /System/Library/Frameworks (as CoreAudio is). But the linker can not find the Kernel framework. Is it forbidden to link with the Kernel framework maybe ?

Any ideas ?

Thanks, Paul

+1  A: 

The kernel framework is just a bunch of headers to allow for sensible communication with kernel and the ability to build kernel extensions There is are no libraries in it to link against a userspace application.

If you are trying to use userspace IOKit functions to communicate with the kernel side of IOKit you should be using IOKit.framework. If you are trying to use functions that are only defined in the Kernel.framework headers from a user space application then you are doing something wrong.

Louis Gerbarg
Ok, this explains it. Thank you!
Paul