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

Linker Errors


  • Subject: Linker Errors
  • From: "K. Chen" <email@hidden>
  • Date: Mon, 28 Sep 2009 20:02:18 -0700

Hi,

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?? 


 _______________________________________________
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

  • Follow-Ups:
    • Re: Linker Errors
      • From: Chris Espinosa <email@hidden>
  • Prev by Date: Re: C++: std::ostringstream default ctor problems
  • Next by Date: Re: Linker Errors
  • Previous by thread: Re: C++ exception breaks inside Apple code
  • Next by thread: Re: Linker Errors
  • Index(es):
    • Date
    • Thread