【发布时间】:2019-01-11 11:58:48
【问题描述】:
我想在 Ubuntu 18.04 上安装 make 3.81。
所以我下载了这个版本的 make 并运行 ./configure,然后 make。但是在编译时它给了我这个错误:
./glob/glob.c: In function ‘glob’:
./glob/glob.c:581:23: warning: implicit declaration of function ‘__alloca’; did you mean ‘alloca’? [-Wimplicit-function-declaration]
newp = (char *) __alloca (dirlen + 1);
^~~~~~~~
alloca
./glob/glob.c:581:14: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
newp = (char *) __alloca (dirlen + 1);
^
./glob/glob.c:709:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
newp = (char *) __alloca (home_len + dirlen);
^
./glob/glob.c:732:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
newp = (char *) __alloca (end_name - dirname);
^
./glob/glob.c:783:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
newp = (char *) __alloca (home_len + rest_len + 1);
^
./glob/glob.c:814:11: warning: implicit declaration of function ‘__stat’; did you mean ‘__xstat’? [-Wimplicit-function-declaration]
: __stat (dirname, &st)) == 0
^~~~~~
__xstat
./glob/glob.c: In function ‘glob_in_dir’:
./glob/glob.c:1256:21: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
char *fullname = (char *) __alloca (dirlen + 1 + patlen + 1);
^
./glob/glob.c:1283:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
names = (struct globlink *) __alloca (sizeof (struct globlink));
^
./glob/glob.c:1341:32: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
struct globlink *new = (struct globlink *)
^
./glob/glob.c:1367:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
names = (struct globlink *) __alloca (sizeof (struct globlink));
构建版本 3.82 的情况相同。我当前的 make 版本是 4.1。
有人知道哪里出了问题吗?
谢谢
编辑:
glob/libglob.a(glob.o):在函数“glob_in_dir”中: /opt/make-3.81/glob/glob.c:1361:未定义对“__alloca”的引用 /opt/make-3.81/glob/glob.c:1336:未定义对“__alloca”的引用 /opt/make-3.81/glob/glob.c:1277:未定义对“__alloca”的引用 /opt/make-3.81/glob/glob.c:1250:未定义对“__alloca”的引用 glob/libglob.a(glob.o):在函数“glob”中: /opt/make-3.81/glob/glob.c:575:未定义对“__alloca”的引用 glob/libglob.a(glob.o):/opt/make-3.81/glob/glob.c:726: 更多未定义的对 `__alloca' 的引用如下 collect2:错误:ld 返回 1 个退出状态 Makefile:410: 目标“make”的配方失败 make[2]: *** [make] 错误 1 make[2]: 离开目录 '/opt/make-3.81' Makefile:603:目标“全递归”的配方失败 make[1]: *** [all-recursive] 错误 1 make[1]: 离开目录 '/opt/make-3.81' Makefile:326:目标“全部”的配方失败 make: *** [全部] 错误 2【问题讨论】:
-
您应该在Ask Ubuntu stackexchange 上提问。虽然这是一个构建工具并且有点主题,但您可能会在安装问题上得到更好的响应
-
只是一个猜测,但您似乎没有包含正确的
.h文件集。对不起,没有想到让你前进。在这里搜索看看其他[make]Qs?祝你好运! -
@scrappedcola 是的,我应该在那里问,不知道为什么我没有想到它:D
-
这些只是警告。你真的得到一个编译错误吗?
make可执行文件是否生成?如果是这样,你就完成了,恭喜!如果没有,您必须向我们展示导致编译失败的 错误 消息,而不是警告。 -
由 AskUbuntu 上的同一 question 解决。这个discussion 中描述并解决了问题