Weak linking problem
Weak linking problem
- Subject: Weak linking problem
- From: Ian Keck <email@hidden>
- Date: Sun, 10 Apr 2005 10:49:38 -0700 (PDT)
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
I'm using XCode 1.5 and have set my Deployment target
to 10.2.8. On 10.3 I'm using the CoreGraphics
function
CGSessionCopyCurrentDictionary() to obtain information
about the current user session. Presumably, with
these settings the CoreGraphics.framework is weak
linked. I can probably get away without using this
function, as I use the information in this dictionary
to get the user name of the current sesson, and the
uid could be substituted.
When I run my application on 10.2.8, it tells me that
CGSessionCopyCurrentDictionary() is not available. It
appears to have been added in 10.3, but the
availability macros are not added to its declaration
in CGSession.h.
In CGSession.h (/System/Library/Frameworks/Application
Services.framework/..../Frameworks/CoreGraphics.framework/.../headers/CGSession.h
), the function is declared as:
CG_EXTERN CFDictionaryRef
CGSessionCopyCurrentDictionary(void);
When I change it to
CG_EXTERN CFDictionaryRef
CGSessionCopyCurrentDictionary(void)
AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
my application links and runs on 10.2.8. The code
that calls the function checks whether it is
available, and does something slightly different when
it isn't.
Our code may not be buildable against the 10.2.8 SDK.
My questions are as follows:
1) Is there a way of telling the linker that this
function should be weak linked.
2) Are there updated headers for 10.3 which reflect
this change.
3) Is there any other way of solving this problem?
Thanks in advance,
Ian Keck
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden