OGeek|极客世界-中国程序员成长平台

标题: ios - 是否可以通过命令行 gcc 编译 iPhone 应用程序? [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-11 20:23
标题: ios - 是否可以通过命令行 gcc 编译 iPhone 应用程序?

如果我想通过命令行 gcc 编译最小的 OSX 应用程序,我可以编译文件 test.m:

#import <AppKit/AppKit.h>
int main( int argc, char** argv ) { return 0; }

通过以下命令:

gcc -c test.m

但是如何以同样的方式编译 iOS 应用程序呢?我将 test.m 更改为引用 iOS cocoa touch :

#import <UIKit/UIKit.h>
int main( int argc, char** argv ) { return 0; }

这不再编译错误:

test.m:1:24: error: UIKit/UIKit.h: No such file or directory



Best Answer-推荐答案


如果您从命令行构建应用程序,您可能希望使用 xcodebuild,因为它们不仅仅包含 Objective-C 文件。

关于ios - 是否可以通过命令行 gcc 编译 iPhone 应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7878214/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4