我正在尝试让 mkbundle 工具在 Mac OS X 10.7 上运行。我安装了 XCode 5,几个不同的 Mono 版本,从 v2 到 v4。每次我尝试编译我的代码时,我都会得到一个
sh: as: command not found
当我试图找到这个命令时,它也不在我的系统上。在谷歌搜索之后,这很难,因为“as”因为过于通用而被过滤掉,我根本找不到解决方案。我能找到的最好的资源说明它是 XCode 的本机编译器,但我已经安装了...
有人可以帮忙吗?
您正在寻找 Xcode 汇编程序:
> 男人作为
NAME
as - Mac OS X Mach-O GNU-based assemblers
SYNOPSIS
as [ option ... ] [ file ... ]
DESCRIPTION
The as command translates assembly code in the named files to object code.
If no files are specified, as reads from stdin. All undefined symbols in
the assembly are treated as global. The output of the assembly is left in
the file a.out by default.
The program /usr/bin/as is actually a driver that executes assemblers for
specific target architectures. If no target architecture is specified, it
defaults to the architecture of the host it is running on.
您是否安装了 Xcode和它的命令行工具?
> which as
/usr/bin/as
> file `which as`
/usr/bin/as: Mach-O 64-bit executable x86_64
位于 Xcode.app:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../libexec/as/x86_64/as
Xcode 命令行工具:
假设您已通过 App Store 安装了“免费”Xcode 包,则可以通过“xcode-select”安装命令行工具。放入术语窗口并:
xcode-选择--帮助
Usage: xcode-select [options]
Print or change the path to the active developer directory. This directory
controls which tools are used for the Xcode command line tools (for example,
xcodebuild) as well as the BSD development commands (such as cc and make).
Options:
-h, --help print this help message and exit
-p, --print-path print the path of the active developer directory
-s <path>, --switch <path> set the path for the active developer directory
--install open a dialog for installation of the command line developer tools
-v, --version print the xcode-select version
-r, --reset reset to the default command line tools path
xcode-选择--安装
安装后,您将通过 App Store 获得更新