• 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
C linkage in C++
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

C linkage in C++


  • Subject: C linkage in C++
  • From: Avi Flamholz <email@hidden>
  • Date: Tue, 29 Nov 2005 20:29:46 -0500

I am working on a extending an open source XCode project. The project
consists of library code (in C), an interface (Interface Builder), and
a controller (Objective-C). I decided to extend the library code with
C++, as I wanted an object oriented language, and I am unfamiliar with
Objective-C. So I wrote my routine in C++ and I wrote a C wrapper.
Normally, when you make a C wrapper for C++, you use the 'extern "C"'
prefix for the function header so that the linker knows to use C-style
function symbols, rather than the mangled C++ kind. When I do this,
however, XCode balks, throwing the following errors:

warning prebinding disabled because dependent library
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit is not
searchable

multiple definitions of symbol _neighborcluster

(where neighborcluster is the name of my routine).

I generally don't care how I make the routine C-callable, but I need
to make it so, as I have already written ~500 lines of code, and I do
not know Objective-C well enough to rewrite it fast enough. I am new
to both the project I am working on, and to XCode, so any help would
be much appreciated.

Does anyone know what the problem might be?

Thanks so much,
-Avi
 _______________________________________________
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

  • Prev by Date: Re: gdb & BOOL
  • Next by Date: RE: xcode 2.2 beachball of death
  • Previous by thread: Re: gdb's tab completion speed?
  • Next by thread: Link problem with custom static library
  • Index(es):
    • Date
    • Thread