首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Makefile 42:目标'util.o‘的配方失败

Makefile 42:目标'util.o‘的配方失败
EN

Ask Ubuntu用户
提问于 2018-11-20 11:01:56
回答 1查看 29.8K关注 0票数 2

我得到了这个错误:

代码语言:javascript
复制
~/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行更改为

代码语言:javascript
复制
Home = /home/shah 
EN

回答 1

Ask Ubuntu用户

回答已采纳

发布于 2018-11-20 11:38:59

如果您尝试这个示例,您将看到exit函数在#include中定义

代码语言:javascript
复制
#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年出版以来,这似乎对他起了作用。

票数 5
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1094484

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档