#import extern "C"{ void display(NSString *text); } @interface Display : NSObject @end #import "Display.h" #include #include using namespace std; void display(NSString *text){ cout << [text cStringUsingEncoding:NSUTF8StringEncoding] << endl; } @implementation Display @end display(@"Hola"); extern "C" void display(NSString *text) { } extern "C" { void display(NSString *text) { } } #ifdef __cplusplus extern "C" { #endif void display(NSString *text); #ifdef __cplusplus } #endif