使用 GCC 在 Ubuntu 上编译 Objective-C

发布于 2024-10-09 19:41:15 字数 360 浏览 0 评论 0原文

好的,我这里有这个程序:

int main(int argc, const char * argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

    NSLog (@"Hello world!");
    [pool drain];
    return 0;
}

问题是当我用命令编译它时 “gcc -framework Foundation prog1.m -o prog1”

我得到这个: “gcc:尝试执行'cclobj'时出错:execvp:没有这样的文件或目录”

我需要安装任何软件包吗? ”

ok 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??
"

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

眉目亦如画i 2024-10-16 19:41:15

这不是唯一的方法,但 GNUStep 对我有用。有关设置的详细文章请查看此处

注意:您的确切错误列在该页面的中间位置。您丢失的软件包似乎是“gobjc”。

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'.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文