• 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 Errors
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Linker Errors


  • Subject: Re: Linker Errors
  • From: Chris Espinosa <email@hidden>
  • Date: Mon, 28 Sep 2009 20:16:34 -0700


On Sep 28, 2009, at 8:02 PM, K. Chen wrote:

I use the Xcode Objective-C source code to make a reference call to a C-callable function. 

1. Knowing that it's C, I use extern "C" declaration to direct the compiler NOT to generate the mangled function reference. Fair enough, Xcode didn't mangle the function reference.
2. I compile my C function with Xcode, and it also generate straight (i.e. unmangled) function symbol.
3. Now when I build them together, Xcode runs into linking error, where the referenced C functions in Objective-C source CANNOT be found. 

I did some digging using 'nm' and found the following:
1. The Objective-C object shows the function foo as. 

U _foo

2. The C object shows the functions as.

00002b27 T _foo
0007acc8 S _foo.eh

Any ideas?? 

U and T go together; U is the usage and T is the export.  .eh is the exception handler entry point.  Everything looks fine there.

Could you drag and drop the Linking item from your build log, and its output, so we can see what the linker is actually being told to do?

Chris

 _______________________________________________
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

References: 
 >Linker Errors (From: "K. Chen" <email@hidden>)

  • Prev by Date: Linker Errors
  • Next by Date: Re: this view is clipping its content (not)
  • Previous by thread: Linker Errors
  • Next by thread: Undefined Symbols
  • Index(es):
    • Date
    • Thread