In Xcode, I made a C++ project. Later, I thought I’d try to learn Obj-C. I renamed the file from ‘main.cpp’ to ‘main.m’.
I provided the following code:
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSLog(@"Programming is fun!");
[pool drain];
return 0;
}
I compiled, and got the following:
“_objc_msgSend”, referenced from:
“_NSLog”, referenced from:
“_OBJC_CLASS_$_NSAutoreleasePool”, referenced from:
“_objc_msgSend_fixup”, referenced from:
“___CFConstantStringClassReference”, referenced from:
Any idea?
It sounds like you aren’t linking against the correct libraries.
The easiest approach is probably to create a new objective-c xcode project and copy your files over.