【问题标题】:I can't compile Objective-C in GNUStep with Windows 7我无法在 Windows 7 的 GNUStep 中编译 Objective-C
【发布时间】:2011-11-20 15:25:21
【问题描述】:

我正在尝试使用 Windows 7 在 GNUStep 中编译以下简单的 Objective-C 代码。

#import <Foundation/Foundation.h>

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

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

我使用以下命令行编译它:

$ gcc `gnustep-config --objc-flags` -L /GNUstep/System/Library/Libraries hello.m -o hello -lgnustep-base -lobjc

它没有编译,我得到以下错误:

sh: gcc : 找不到命令

【问题讨论】:

  • 你的开发环境是如何设置的——你安装了什么? gcc: command not found 表示您忘记安装或安装错误。
  • 我已经安装了两个require file.also 核心文件。
  • 如果这是一台unix机器,我会说Shell还不知道gcc。您要么必须重新加载 shell 配置,要么需要将 gcc 添加到搜索路径中。

标签: objective-c gnustep


【解决方案1】:

你必须安装以上所有组件然后你可以使用foundantion.h

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-28
    相关资源
    最近更新 更多