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



Sounds like either:

1)  Make sure that all your files are "checked" in the project views
(this means that they will all have to be compiled)

and/or

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.

BTW, <presenter.h> usually indicates a system file while "presenter.h"
indicates a project file.

OR

3)  Something else and I'm sure someone will correct me if and when
I'm wrong ;-)

FWIW, if your problem is #2 and you don't have that problem under
Visual Studio under the same circumstances then start losing sleep...

Cheers,
H.

On 10/28/05, Kenny Millar <email@hidden> wrote:
> Please forgive me if this is a duplicate post - I got a bounce for
> the original post so not sure if it got here or not.
>
> Newbie question re linker.
> I decided it would be better to separate my code into various .cpp/.h
> files instead of having everything in main.c.
>
> To start with I moved just one function ( PresenterWindowEvHandler )
> into presenter.h and presenter.cpp
> It is declared in presenter.h as
>      pascal OSStatus PresenterWindowEvHandler(EventHandlerCallRef
> callRef, EventRef event, void *userData);
>
> and implemented in presenter.cpp, my main.c file has this line:
>
>      #include <presenter.h>
>
> My app is a straightforward carbon app, in XCode 1.5
>
> The whole app builds without any warnings or errors, and presenter.h
> and presenter.cpp are both under 'sources' in the project window.
> The problem is that when I run the app it immediately exists with
> this error:
>
>      [Session started at 2005-10-28 17:54:59 +0100.]
>      ZeroLink: unknown symbol '_PresenterWindowEvHandler'
>
> Not sure where to go from here with this, I have a confession to
> make... in my day job I'm a Visual C++ developer for the dark
> (Windows) side. In VC++ I don't need to do anything other than I've
> done above.
>
> Is it because main.c is a '.c' file and the new file is '.cpp' or is
> there some other thing I need to do to get the code in my new files
> linked into the final app?????
>
> Thanks in advance for helping out a poor newbie.
> -Kenny
>
>  _______________________________________________
> 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
>
 _______________________________________________
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: 
 >[newbie] Linker question (From: Kenny Millar <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.