Mac Xcode: Framework Headers

babazaroni

macrumors newbie
Original poster
Mar 19, 2010
12
0
Hello,

I've added Kernel.framework from sdk10.5 to my kext project and I'm using mach/mach.h in a file.

But, I get a compile error because mach.h is not in kernel.framework/versions/a/headers/mach. But it is in versions/a/headers/libsa/mach.

So how do I get Xcode to find this mach.h without adding an include path or adding libsa to the include directive?

Thanks
 

gnasher729

macrumors P6
Nov 25, 2005
16,977
3,896
Hello,

I've added Kernel.framework from sdk10.5 to my kext project and I'm using mach/mach.h in a file.

But, I get a compile error because mach.h is not in kernel.framework/versions/a/headers/mach. But it is in versions/a/headers/libsa/mach.

So how do I get Xcode to find this mach.h without adding an include path or adding libsa to the include directive?

Thanks
So what's wrong with #include "libsa/mach/mach.h"?
 

babazaroni

macrumors newbie
Original poster
Mar 19, 2010
12
0
So what's wrong with #include "libsa/mach/mach.h"?
It just seems non-standard. When I see code from various projects I always see #include <mach/mach.h>.

When I do solutions like this, it makes me wonder what else I'm missing, or I'm setting myself up for trouble later.

Why is mach.h not in the mach directory? I'm sure there is a very good reason.

BTW, i'm trying to learn mach port ipc in the kernel. If anyone knows of an xcodeproj demonstrating this, I'd sure like a link.
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
5
It just seems non-standard. When I see code from various projects I always see #include <mach/mach.h>.
Because that is where it exists, inside /usr/include. That is the standard location for it. I don't know what Kernel.framework is for but I don't think it's what you want.

BTW, i'm trying to learn mach port ipc in the kernel. If anyone knows of an xcodeproj demonstrating this, I'd sure like a link.
What do you mean by "in the kernel"? As a kext?
 

babazaroni

macrumors newbie
Original poster
Mar 19, 2010
12
0
Yes, as a kext. I need ipc between two kexts.

The rest of my project has dependencies on kernel.framework.

I'm doing kernel work, why can't I use the mach.h in the kernel framework. What's it there for if you have to go outside the framework to find it, but all the include files and libraries it uses are in kernel framework? Does not make sense to me.

What if I built my kext against an earlier sdk then my system?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.