开发者

compiling Objective-C on Ubuntu using GCC

开发者 https://www.devze.com 2023-02-01 09:16 出处:网络
o开发者_运维问答k i have this program here: int main(int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号