使用cygwin编译git v1.8.0源码报错

Tody Guo 2012-10-23 08:59:48
各位大侠,
我在cygwin中使用make编译下载下来的git源码。
发现如下错误。还请帮忙有什么解决方案。谢谢哈。

CC compat/cygwin.o
In file included from /usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/winnt.h:16:0,
from /usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/windef.h:139,
from /usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../include/w32api/windows.h:69,
from compat/win32.h:6,
from compat/cygwin.c:3:
/usr/include/ctype.h:8:5: 错误:expected ‘)’ before ‘__c’
/usr/include/ctype.h:8:5: 错误:expected expression before ‘]’ token
/usr/include/ctype.h:8:5: 错误:expected ‘)’ before ‘!=’ token
/usr/include/ctype.h:9:5: 错误:expected ‘)’ before ‘__c’
/usr/include/ctype.h:9:5: 错误:expected expression before ‘]’ token
/usr/include/ctype.h:9:5: 错误:expected ‘)’ before ‘!=’ token
/usr/include/ctype.h:11:5: 错误:expected ‘)’ before ‘__c’
/usr/include/ctype.h:11:5: 错误:expected expression before ‘]’ token
/usr/include/ctype.h:11:5: 错误:expected ‘)’ before ‘!=’ token
/usr/include/ctype.h:13:5: 错误:expected declaration specifiers or ‘...’ before numeric constant
/usr/include/ctype.h:13:5: 错误:与‘sane_iscase’类型冲突
compat/../git-compat-util.h:541:19: 附注:‘sane_iscase’的上一个定义在此
/usr/include/ctype.h:16:5: 错误:expected ‘)’ before ‘__c’
/usr/include/ctype.h:16:5: 错误:expected expression before ‘]’ token
/usr/include/ctype.h:16:5: 错误:expected ‘)’ before ‘!=’ token
/usr/include/ctype.h:17:5: 错误:expected declaration specifiers or ‘...’ before numeric constant
/usr/include/ctype.h:19:5: 错误:expected declaration specifiers or ‘...’ before ‘(’ token
/usr/include/ctype.h:19:5: 错误:expected declaration specifiers or ‘...’ before numeric constant
/usr/include/ctype.h:20:5: 错误:expected declaration specifiers or ‘...’ before ‘(’ token
/usr/include/ctype.h:20:5: 错误:expected declaration specifiers or ‘...’ before numeric constant
/usr/include/ctype.h:27:5: 错误:expected identifier or ‘(’ before ‘int’
/usr/include/ctype.h:27:5: 错误:expected ‘)’ before ‘&’ token
/usr/include/ctype.h:27:5: 错误:expected ‘)’ before ‘==’ token
Makefile:2376: recipe for target `compat/cygwin.o' failed
make: *** [compat/cygwin.o] Error 1

...全文
433 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
agateriver 2013-01-31
  • 打赏
  • 举报
回复
cygwin升级到最新,下载git 1.8.1 源码编译通过。
Tody Guo 2012-10-26
  • 打赏
  • 举报
回复
这个怎么解啊?是不是那个ctype.h的问题?
agateriver 2012-10-24
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 的回复:]

楼上也是因为 /usr/include/ctype.h 这个错误导致?
[/Quote]

一模一样
Tody Guo 2012-10-24
  • 打赏
  • 举报
回复
楼上也是因为 /usr/include/ctype.h 这个错误导致?
agateriver 2012-10-23
  • 打赏
  • 举报
回复
cygwin自带的git太老,还是1.7.9的。
我在cygwin上编译1.7.12.4也出现楼主一样的错误。但是我发现在另外两台机器上(win7 x64+最新的cygwin)上却能正常编译通过,反而在一台刚装的机器上(也是win7 x64+最新的cygwin)编译不过。google解决方案及尝试安装/卸载各种依赖都解决不了问题,实在苦恼。
图灵狗 2012-10-23
  • 打赏
  • 举报
回复
也可以按照下面的方法进行安装:
默认安装的Cygwin没有安装Git软件包。如果在首次安装过程中忘记通过包管理器选择安装Git或其他相关软件包,可以在安装后再次运行Cygwin的安装程序setup.exe。当再次进入 Cygwin 包管理器界面时,在搜索框中输入git并安装所有相关软件包。

69,369

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧