• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Linker error: symbol(s) not found
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Linker error: symbol(s) not found


  • Subject: Re: Linker error: symbol(s) not found
  • From: "Julien Jalon" <email@hidden>
  • Date: Wed, 3 Sep 2008 23:02:01 +0200

In the header declaring DGBoardRepFromGame, make sure to declare it extern
"C".
#ifdef __cplusplus
extern "C" {
#endif

extern DGBoardRepFromGame(DGGame*, char*);

#ifdef __cplusplus
}
#endif

On Wed, Sep 3, 2008 at 10:40 PM, Joachim <email@hidden> wrote:

> Dear list,
>
> I'm getting a linker error, and it's not a missing inclusion of a
> framework. I suspect it has to do with mixing .m and .mm files, but I'm
> actually pretty clueless.
>
> This is the output from the build:
>
>    "DGBoardRepFromGame(DGGame*, char*)", referenced from:
>    -[DGTinyEngine setPositionFromGame:error:] in DGTinyEngine.o
>    ld: symbol(s) not found
>    collect2: ld returned 1 exit status
>
> In my otherwise Objective-C only project, DGTinyEngine.mm is using a C++
> engine, hence the need to make it an Objective-C++ file. It imports a
> "DGFunctions.h" file that amongst other general C functions declares the
> void DGBoardRepFromGame (DGGame *game, DGBoardRep buffer) function. The
> function is implemented in a .m file.
>
> It is the call in DGTinyEngine.mm to this function that causes the linker
> error. If I comment out the call to DGBoardRepFromGame, the project links
> fine. DGGame is an Objective-C class that is used several places in
> DGTinyEngine.mm without causing any problems.
>
> What causes the linker error, and what can I do to avoid it?
>
> Thanks in advance,
> Joachim
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Linker error: symbol(s) not found (From: Joachim <email@hidden>)

  • Prev by Date: Re: View animator, how to do explicit animations / animation groups?
  • Next by Date: Re: Disclosure Triangle - how to set Selected programatically?
  • Previous by thread: Linker error: symbol(s) not found
  • Next by thread: Re: NSString/NSMutable String Concatenation
  • Index(es):
    • Date
    • Thread