【问题标题】:What steps are required to make the Xcode 8 Command Line Tools template build? [closed]构建 Xcode 8 命令行工具模板需要哪些步骤? [关闭]
【发布时间】:2016-09-16 18:10:27
【问题描述】:

在 XCode 8 中没有为我构建 MacOS 命令行工具的模板项目。这是整个代码:

#import <Foundation/Foundation.h>

int main(int argc, const char * argv[]) {
    @autoreleasepool {
        // insert code here...
        NSLog(@"Hello, World!");
    }
    return 0;
}

失败发生在导入行。错误输出的开头重现如下。

我有一台运行 El Capitan 的新机器。大约一周前,我从 GM 下载(不是应用商店)安装了 Xcode 8。

我需要做什么才能构建它?

错误输出:

In file included from /Users/ahcox/dev/macos/CommandLine001/CommandLine001/main.m:9:
In file included from /Users/ahcox/Downloads/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:48:
In file included from /Users/ahcox/Downloads/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSKeyedArchiver.h:9:
/Users/ahcox/Downloads/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSGeometry.h:20:9: error: unknown type name 'CGPoint'; did you mean 'Point'?
typedef CGPoint NSPoint;
        ^
In file included from /Users/ahcox/dev/macos/CommandLine001/CommandLine001/main.m:9:
In file included from /Users/ahcox/Downloads/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
In file included from /Users/ahcox/Downloads/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:43:
In file included from /Users/ahcox/Downloads/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:77:
/Users/ahcox/Downloads/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/MacTypes.h:542:41: note: 'Point' declared here
typedef struct Point                    Point;
                                        ^
...

【问题讨论】:

  • 请投票结束。在这个问题中,我基本上是在问如何在 MacOS 上安装应用程序而没有意识到这一点。 Xcode 是我在我的第一台 Mac 上安装的第一个应用程序:-)。

标签: objective-c xcode macos xcode8


【解决方案1】:

/Applications/下安装Xcode

查看这些路径,Xcode 直接从下载目录运行,它是从 GM 种子 xip 文件中解压出来的(即它在 "/Users/ahcox/Downloads/Xcode.app/" 中)。要么手动将其复制到/Applications/,要么运行 App Store 应用程序并让它在需要的位置安装 Xcode。为了自己解决这个问题,我做了后者。 有关installation of apps on MacOS 的更多信息。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-03-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-21
    • 2023-03-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多