I know it is possible to use Objective C code using objc_msgSend to, I believe, manually run the Objective C runtime however when I run this code I get errors referencing NSString (even though I never use it) as well as other un-used classes.
Errors from xcode
I have the Objective C Code above it (commented out) that I am trying to 'mimic'.
#include <Foundation/Foundation.h> /*Added suggestion by answer, same errors*/
#include <AppKit/AppKit.h>
int main()
{
// convert objective c into c code
/*
NSAlert *alert = [[NSAlert alloc] init];
[alert setAlertStyle:NSInformationalAlertStyle];
[alert setMessageText:@"Hello World"];
[alert setInformativeText:@"Hello World"];
[alert runModal];
*/
id alert = objc_msgSend(objc_msgSend(objc_getClass("NSAlert"), sel_registerName("alloc")), sel_registerName("init"));
objc_msgSend(alert, sel_getUid("setAlertStyle:"), NSInformationalAlertStyle);
objc_msgSend(alert, sel_getUid("setMessageText:"), CFSTR("Hello World!"));
objc_msgSend(alert, sel_getUid("setInformativeText:"), CFSTR("Hello World!"));
objc_msgSend(alert, sel_getUid("runModal"));
}