Reputation: 696
In my OS X app, I'm calling SCPreferencesCreateWithAuthorization which is found in the SystemConfiguration framework:
AuthorizationRef auth;
AuthorizationCreate(NULL, NULL, kAuthorizationFlagDefaults, &auth);
SCPreferencesRef prefRef = SCPreferencesCreateWithAuthorization(kCFAllocatorDefault,CFSTR("Get Connected"), NULL, auth);
This works fine on Lion, but when I run the app in Snow Leopard, it crashes when that function is called. The odd thing is that the crash log indicates that it thinks this symbol is found in IOKit
Dyld Error Message:
Symbol not found: _SCPreferencesCreateWithAuthorization
Referenced from: /Users/localadmin/Downloads/Get Connected.app/Contents/MacOS/Get Connected
Expected in: /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
I've linked the SystemConfiguration.framework to the target in Xcode and imported the header in my AppDelegate.h:
#import <SystemConfiguration/SystemConfiguration.h>
What am I doing wrong? Why does it work under Lion, but not Snow Leopard. The docs say that it is available in 10.5 and later.
Upvotes: 1
Views: 280
Reputation: 90531
Are you also linking against IOKit? Try moving SystemConfiguration earlier in the link order.
It appears that that symbol is also present in the IOKit framework on Lion. I'm not sure if the the symbol in SystemConfiguration is just an alias for the one in IOKit.
Anyway, your app has a dependency on the one in IOKit, which is undesirable.
You might be able to check this with nm -g -m ~/"Downloads/Get Connected.app/Contents/MacOS/Get Connected" | grep SCPref
.
Upvotes: 2