0

我正在观看此视频以使用 Homebrew 安装 git。我已经安装了 Homebrew。我遇到的问题是使用 Homebrew 安装 git。我输入了 brew install git 并有某些错误消息。

错误信息:

./generate-cmdlist.sh > common-cmds.h+ && mv common-cmds.h+ common-cmds.h
/usr/bin/xcrun clang -o hex.o -c -MF ./.depend/hex.o.d -MMD -MP  -Os -w -pipe -march=native -Qunused-arguments -I. -DUSE_ST_TIMESPEC -DNO_GETTEXT  -DHAVE_DEV_TTY -DSHA1_HEADER='<openssl/sha.h>'  -DNO_MEMMEM  hex.c
/usr/bin/xcrun clang -o ident.o -c -MF ./.depend/ident.o.d -MMD -MP  -Os -w -pipe -march=native -Qunused-arguments -I. -DUSE_ST_TIMESPEC -DNO_GETTEXT  -DHAVE_DEV_TTY -DSHA1_HEADER='<openssl/sha.h>'  -DNO_MEMMEM  ident.c
/usr/bin/xcrun clang -o kwset.o -c -MF ./.depend/kwset.o.d -MMD -MP  -Os -w -pipe -march=native -Qunused-arguments -I. -DUSE_ST_TIMESPEC -DNO_GETTEXT  -DHAVE_DEV_TTY -DSHA1_HEADER='<openssl/sha.h>'  -DNO_MEMMEM  kwset.c
In file included from ident.c:8:
In file included from ./cache.h:4:
./git-compat-util.h:93:10: fatal error: 'unistd.h' file not found
#include <unistd.h>
         ^
In file included from hex.c:1:
In file included from ./cache.h:4:
./git-compat-util.h:93:10: fatal error: 'unistd.h' file not found
#include <unistd.h>
         ^
In file included from kwset.c:37:
In file included from ./cache.h:4:
./git-compat-util.h:93:10: fatal error: 'unistd.h' file not found
#include <unistd.h>
         ^
1 error generated.
make: *** [hex.o] Error 1
1 error generated.
make: *** Waiting for unfinished jobs....
make: *** [ident.o] Error 1
1 error generated.
make: *** [kwset.o] Error 1
==> Build Environment
CPU: quad-core 64-bit sandybridge
MacOS: 10.7.4-x86_64
Xcode: 4.3.2
CC: /usr/bin/xcrun clang => /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang

CXX: /usr/bin/xcrun clang++ => /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++

LD: /usr/bin/xcrun clang => /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang

CFLAGS: -Os -w -pipe -march=native -Qunused-arguments
CXXFLAGS: -Os -w -pipe -march=native -Qunused-arguments
MAKEFLAGS: -j4
Error: Failed executing: make prefix=/usr/local/Cellar/git/1.7.10.3 CC=/usr/bin/xcrun\ clang CFLAGS=-Os\ -w\ -pipe\ -march=native\ -Qunused-arguments LDFLAGS= install (git.rb:49)
These existing issues may help you:
    https://github.com/mxcl/homebrew/issues/8643
    https://github.com/mxcl/homebrew/issues/9023
    https://github.com/mxcl/homebrew/issues/9618
    https://github.com/mxcl/homebrew/issues/10544
    https://github.com/mxcl/homebrew/issues/11481
    https://github.com/mxcl/homebrew/issues/12325
    https://github.com/mxcl/homebrew/issues/12344
    https://github.com/mxcl/homebrew/issues/12400
    https://github.com/mxcl/homebrew/issues/12478
Otherwise, please report the bug:
    https://github.com/mxcl/homebrew/wiki/reporting-bugs

我该如何解决这个错误?需要一些帮助

4

2 回答 2

5

您必须通过 Xcode 安装命令行工具才能获取所需的标头。

于 2012-06-01T15:21:07.643 回答
-1

我建议你下载它。另外,如果您使用 github,我建议您阅读此页面。一年前,我以这种方式开始。

于 2012-06-01T05:11:10.257 回答