Re: std::log10() problem
Re: std::log10() problem
- Subject: Re: std::log10() problem
- From: Bill Monk <email@hidden>
- Date: Wed, 5 Apr 2006 12:21:14 -0500
On 3/29/06, Chris Espinosa wrote:
Setting the Deployment Target does a lot of things: it triggers
weak linking in the frameworks that support weak linking and it
controls certain compiler and linker behavior for runtime
libraries. But as documented in the Cross-Development Programming
Guide, not all libraries (especially open-source ones) support the
weak-linking features that are triggered by the Deployment Target
setting, so you mave to manage weak-linking for these manually.
This makes sense, but here's something I don't understand.
The 10.4 API FSCreateStringFromHFSUniStr() is marked
AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER, which is #defined to be
WEAK_IMPORT_ATTRIBUTE when building for 10.4 or greater. So when
using the 10.4u SDK (gnu C/C++ 4.0) and a MACOSX_DEPLOYMENT_TARGET <
10.4 it should be weak linked, correct?
But as an example, consider the following code (similar to the
example at
http://developer.apple.com/documentation/DeveloperTools/Conceptual/
cross_development/Using/chapter_3_section_5.html)
CFStringRef ConvertHFSUniStr255ToCFString( ConstHFSUniStr255Param
myHFSUniStrPtr )
{
CFStringRef myCFString = NULL;
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 )
if ( NULL != FSCreateStringFromHFSUniStr )
{
myCFString = FSCreateStringFromHFSUniStr( kCFAllocatorDefault,
myHFSUniStrPtr );
}
else
#endif
{
myCFString = CFStringCreateWithCharacters( kCFAllocatorDefault,
myHFSUniStrPtr->unicode,
myHFSUniStrPtr->length );
}
return myCFString;
}
When compiled with 10.3 SDK and MACOSX_DEPLOYMENT_TARGET == 10.3, the
#if block compiles out and the app runs fine on 10.3.9.
When compiled with 10.4u SDK and MACOSX_DEPLOYMENT_TARGET == 10.3,
the #if block compiles in, and the app runs fine on 10.4.x. When run
on 10.3.9, however, it crashes, like this:
Link (dyld) error:
dyld: /TestApp.app/Contents/MacOS/TestApp Undefined symbols:
/TestApp.app/Contents/MacOS/TestApp undefined reference to
_FSCreateStringFromHFSUniStr expected to be defined in CoreServices
(CoreServices.framework is in the project, btw.)
It seems to me this should be weak-linked. What am I not
understanding here?
_______________________________________________
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