Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [newbie] Linker question



On 10/28/05 9:30 PM, Dave Rehring didst favor us with:

> On 10/28/05 4:54 PM, Laurence Harris at email@hidden wrote:
> 
>> On 10/28/05 6:23 PM, Herb Petschauer didst favor us with:
>> 
>>> On 10/28/05, Laurence Harris <email@hidden> wrote:
>>>> On 10/28/05 5:54 PM, Herb Petschauer didst favor us with:
>>>> 
>>>>> 2)  Your C code is looking for the _PresenterWindowEvHandler
>>>>> C-function.  Sadly, you've compiled it with a C++ compiler and it may
>>>>> have been mangled to a different symbol name.  Try adding
>>>>> 
>>>>> #ifdef __cplusplus
>>>>> extern "C" {
>>>>> #endif
>>>>> 
>>>>> pascal OSStatus PresenterWindowEvHandler(EventHandlerCallRef
>>>>> callRef, EventRef event, void *userData);
>>>>> 
>>>>> #ifdef __cplusplus
>>>>> }
>>>>> #endif
>>>>> 
>>>>> to your presenter.h file.
>>>> 
>>>> You don't need to do this. If the compiler mangles the name it will look
>>>> for
>>>> the mangled name.
>>> 
>>> Not when you're building a kext it doesn't :-)  And I've seen it in
>>> userland as well.
>> 
>> I see. If you're calling it from outside, then you need this, but from
>> within your own application it shouldn't be necessary. At least, I've never
>> had to do it.
> 
> It is necessary if the function is compiled in a C file, but called from a
> file compiled as C++.  But nowadays, most people just enable the C++
> compiler for all files...

Ah, okay. I use the C++ compiler all the time. Now I remember why. ;-)

Larry

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden

References: 
 >Re: [newbie] Linker question (From: Dave Rehring <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.