1

I am trying to include XPC api framework in the SMJobBless sample provided by apple here:

https://developer.apple.com/librarY/mac/samplecode/SMJobBless/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010071-Intro-DontLinkElementID_2

But adding this:

#include <xpc/xpc.h>

to the SMJobBlessHelper.c file gives me this:

Xpc/xpc.h: No such file or directory.

What is missing and where should it be?

2 Answers 2

1

The xpc.h file is located in SDK ROOT/usr/include/xpc/ which for me is

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/xpc

I would guess that your base SDK configuration is incorrect. Do you have a valid SDK selected? You might want to change it and then change it back. Sometimes Xcode can be weird about that.

I just downloaded that sample code and put the include into the SMJobBlessHelper.c file and it compiled with no problems (on 10.9.3, Xcode 5.1.1).

Note that there isn't a separate XPC framework that you have to include, it's just part of the standard system libraries.

Also, if you are trying to write an XPC service for privileged operations, you will probably need to do a lot of googling for additional information. Apple's documentation on that is pretty weak. This was helpful to me: http://atnan.com/blog/2012/02/29/modern-privileged-helper-tools-using-smjobbless-plus-xpc Some of the plist entries and compile settings are difficult to figure out.

2
0

Everything froom way back when has XPC.... Just looking at my machine here, I can see it in:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/xpc/xpc.h /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/xpc/xpc.h /EMI/Xcode/sdks/MacOSX10.8.sdk/usr/include/xpc/xpc.h

Are you including ?

And have you tried the XPC template that comes with Xcode?

Not the answer you're looking for? Browse other questions tagged or ask your own question.