我得到了这个错误:
~/Distrib$ make all
/usr/bin/g++ -O3 util.cc -I/home/shah/Distrib
util.cc: In function 'into countLines(const char*)':
util:19:8: error: 'exit' was not declared in this scope
exit(1);
^
Makefile:42: recipe for target 'util.o' failed
make: *** [util.o] Error 1基本上,我正在尝试安装一个从本网页下载的断层扫描软件。
我将Makefile中的第5行更改为
Home = /home/shah 
发布于 2018-11-20 11:38:59
如果您尝试这个示例,您将看到exit函数在#include中定义
#include <stdio.h>
#include <stdlib.h>
int main () {
printf("Start of the program....\n");
printf("Exiting the program....\n");
exit(0);
printf("End of the program....\n");
return(0);
}提供错误的文件util.cc不包含C的StdLib。这就是错误的原因。
赞纳在之前的评论中提到了这个错误。在任何情况下,都要问提交人,就像他所做的那样。自2003年出版以来,这似乎对他起了作用。
https://askubuntu.com/questions/1094484
复制相似问题