• 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: How to call functions of a C dylib on a C++ dylib
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to call functions of a C dylib on a C++ dylib


  • Subject: Re: How to call functions of a C dylib on a C++ dylib
  • From: Stefan Werner <email@hidden>
  • Date: Thu, 18 Sep 2008 09:01:55 -0700


On Sep 18, 2008, at 7:53 AM, Kiel Gillard wrote:

Howdy,

I think the following syntax is the right idea:

extern "C" {     extern void MyFunction(void *args);
}

I'm not sure about the duplicate 'extern'. Here's what I use in my code:

extern "C" void MyFunction(void *args);

or you can also do

extern "C" {
#include "MyCHeader.h"
}

for entire header files.

Also, you can use 'nm -o libSomething.dylib' do inspect the function signatures a certain lib exports.

-Stefan
_______________________________________________

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: 
 >Re: How to call functions of a C dylib on a C++ dylib (From: "Kiel Gillard" <email@hidden>)

  • Prev by Date: Re: Modal dialog without NSApplication
  • Next by Date: Re: Modal dialog without NSApplication
  • Previous by thread: Re: How to call functions of a C dylib on a C++ dylib
  • Next by thread: Poking an NSRunLoop with an NSMachPort
  • Index(es):
    • Date
    • Thread