compiling Objective-C on Ubuntu using GCC
o开发者_运维问答k i have this program here:
int main(int argc, const char * argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSLog (@"Hello world!");
[pool drain];
return 0;
}
the problem is when i compile it with the command "gcc -framework Foundation prog1.m -o prog1"
i get this: "gcc: error trying to exec 'cclobj' : execvp: No such file or Directory"
do i need to install any packages?? "
Its not the only way but GNUStep worked for me. For a good writeup on setting it up look here.
Note: Your exact error is listed about halfway down that page. Your missing package seems to be 'gobjc'.
You need to install "gobjc"
Example
gcc -x objective-c -o
check this link Compiling Objective-C using the gcc
http://webcache.googleusercontent.com/search?q=cache:iIgkFc-JoRYJ:https://www.cs.indiana.edu/classes/c304/ObjCompile.html+http://www.it.uc3m.es/mibanez/lao/lab1/tutorial3/ObjCompile.html&cd=1&hl=en&ct=clnk&client=safari
精彩评论