Makefile 42: recipe for target 'util.o' failed
up vote
2
down vote
favorite
I am getting this error:
~/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
Basically I am trying to install a piece of tomographic software that I downloaded from this webpage
I changed line number 5 in the Makefile to
Home = /home/shah
compiling c++ makefile
|
show 2 more comments
up vote
2
down vote
favorite
I am getting this error:
~/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
Basically I am trying to install a piece of tomographic software that I downloaded from this webpage
I changed line number 5 in the Makefile to
Home = /home/shah
compiling c++ makefile
Line 5 before any change was HOME = /Users/jon Show I add the missing header with hashtag sign or without it. I added it the way you typed above in the Makefile and got the same error. Then I removed the hashtag at the beginning and it gave me following error $ Makefile :2: No such file or directory $ make: ***no rule to make target '<stdlib.h>'. Stop.
– Shah
Nov 20 at 11:25
1
Different compilers sometimes allow implicit exit() declaration. Just put#include <cstdlib>
into the cc files that fail to compile.
– Alvin Liang
Nov 20 at 11:25
2
@Shaw No,#include <stdlib.h>
or#include <cstdlib>
should goes to *.cc, not Makefile
– Alvin Liang
Nov 20 at 11:28
2
Thanks Alvin and Zanna. You guys are awesome. I included the #include <stdlib.h> in util.cc and other files,which solved the problem.
– Shah
Nov 20 at 11:43
Related on Stack Overflow
– Zanna
Nov 20 at 12:37
|
show 2 more comments
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I am getting this error:
~/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
Basically I am trying to install a piece of tomographic software that I downloaded from this webpage
I changed line number 5 in the Makefile to
Home = /home/shah
compiling c++ makefile
I am getting this error:
~/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
Basically I am trying to install a piece of tomographic software that I downloaded from this webpage
I changed line number 5 in the Makefile to
Home = /home/shah
compiling c++ makefile
compiling c++ makefile
edited Nov 20 at 12:47
Zanna
49.4k13127236
49.4k13127236
asked Nov 20 at 11:01
Shah
134
134
Line 5 before any change was HOME = /Users/jon Show I add the missing header with hashtag sign or without it. I added it the way you typed above in the Makefile and got the same error. Then I removed the hashtag at the beginning and it gave me following error $ Makefile :2: No such file or directory $ make: ***no rule to make target '<stdlib.h>'. Stop.
– Shah
Nov 20 at 11:25
1
Different compilers sometimes allow implicit exit() declaration. Just put#include <cstdlib>
into the cc files that fail to compile.
– Alvin Liang
Nov 20 at 11:25
2
@Shaw No,#include <stdlib.h>
or#include <cstdlib>
should goes to *.cc, not Makefile
– Alvin Liang
Nov 20 at 11:28
2
Thanks Alvin and Zanna. You guys are awesome. I included the #include <stdlib.h> in util.cc and other files,which solved the problem.
– Shah
Nov 20 at 11:43
Related on Stack Overflow
– Zanna
Nov 20 at 12:37
|
show 2 more comments
Line 5 before any change was HOME = /Users/jon Show I add the missing header with hashtag sign or without it. I added it the way you typed above in the Makefile and got the same error. Then I removed the hashtag at the beginning and it gave me following error $ Makefile :2: No such file or directory $ make: ***no rule to make target '<stdlib.h>'. Stop.
– Shah
Nov 20 at 11:25
1
Different compilers sometimes allow implicit exit() declaration. Just put#include <cstdlib>
into the cc files that fail to compile.
– Alvin Liang
Nov 20 at 11:25
2
@Shaw No,#include <stdlib.h>
or#include <cstdlib>
should goes to *.cc, not Makefile
– Alvin Liang
Nov 20 at 11:28
2
Thanks Alvin and Zanna. You guys are awesome. I included the #include <stdlib.h> in util.cc and other files,which solved the problem.
– Shah
Nov 20 at 11:43
Related on Stack Overflow
– Zanna
Nov 20 at 12:37
Line 5 before any change was HOME = /Users/jon Show I add the missing header with hashtag sign or without it. I added it the way you typed above in the Makefile and got the same error. Then I removed the hashtag at the beginning and it gave me following error $ Makefile :2: No such file or directory $ make: ***no rule to make target '<stdlib.h>'. Stop.
– Shah
Nov 20 at 11:25
Line 5 before any change was HOME = /Users/jon Show I add the missing header with hashtag sign or without it. I added it the way you typed above in the Makefile and got the same error. Then I removed the hashtag at the beginning and it gave me following error $ Makefile :2: No such file or directory $ make: ***no rule to make target '<stdlib.h>'. Stop.
– Shah
Nov 20 at 11:25
1
1
Different compilers sometimes allow implicit exit() declaration. Just put
#include <cstdlib>
into the cc files that fail to compile.– Alvin Liang
Nov 20 at 11:25
Different compilers sometimes allow implicit exit() declaration. Just put
#include <cstdlib>
into the cc files that fail to compile.– Alvin Liang
Nov 20 at 11:25
2
2
@Shaw No,
#include <stdlib.h>
or #include <cstdlib>
should goes to *.cc, not Makefile– Alvin Liang
Nov 20 at 11:28
@Shaw No,
#include <stdlib.h>
or #include <cstdlib>
should goes to *.cc, not Makefile– Alvin Liang
Nov 20 at 11:28
2
2
Thanks Alvin and Zanna. You guys are awesome. I included the #include <stdlib.h> in util.cc and other files,which solved the problem.
– Shah
Nov 20 at 11:43
Thanks Alvin and Zanna. You guys are awesome. I included the #include <stdlib.h> in util.cc and other files,which solved the problem.
– Shah
Nov 20 at 11:43
Related on Stack Overflow
– Zanna
Nov 20 at 12:37
Related on Stack Overflow
– Zanna
Nov 20 at 12:37
|
show 2 more comments
1 Answer
1
active
oldest
votes
up vote
5
down vote
accepted
If you try this example you will see that the exit function is defined in #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);
}
The file util.cc, which gives error does not contain the inclusion of StdLib of C.
That's why the error.
The mistake was mentioned by Zanna in the previous comment.
In any case, ask the author, as he did to compile it. Since the 2003 publication, it seems that it worked for him.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1094484%2fmakefile-42-recipe-for-target-util-o-failed%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
accepted
If you try this example you will see that the exit function is defined in #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);
}
The file util.cc, which gives error does not contain the inclusion of StdLib of C.
That's why the error.
The mistake was mentioned by Zanna in the previous comment.
In any case, ask the author, as he did to compile it. Since the 2003 publication, it seems that it worked for him.
add a comment |
up vote
5
down vote
accepted
If you try this example you will see that the exit function is defined in #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);
}
The file util.cc, which gives error does not contain the inclusion of StdLib of C.
That's why the error.
The mistake was mentioned by Zanna in the previous comment.
In any case, ask the author, as he did to compile it. Since the 2003 publication, it seems that it worked for him.
add a comment |
up vote
5
down vote
accepted
up vote
5
down vote
accepted
If you try this example you will see that the exit function is defined in #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);
}
The file util.cc, which gives error does not contain the inclusion of StdLib of C.
That's why the error.
The mistake was mentioned by Zanna in the previous comment.
In any case, ask the author, as he did to compile it. Since the 2003 publication, it seems that it worked for him.
If you try this example you will see that the exit function is defined in #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);
}
The file util.cc, which gives error does not contain the inclusion of StdLib of C.
That's why the error.
The mistake was mentioned by Zanna in the previous comment.
In any case, ask the author, as he did to compile it. Since the 2003 publication, it seems that it worked for him.
answered Nov 20 at 11:38
Carlos Dagorret
33815
33815
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1094484%2fmakefile-42-recipe-for-target-util-o-failed%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Line 5 before any change was HOME = /Users/jon Show I add the missing header with hashtag sign or without it. I added it the way you typed above in the Makefile and got the same error. Then I removed the hashtag at the beginning and it gave me following error $ Makefile :2: No such file or directory $ make: ***no rule to make target '<stdlib.h>'. Stop.
– Shah
Nov 20 at 11:25
1
Different compilers sometimes allow implicit exit() declaration. Just put
#include <cstdlib>
into the cc files that fail to compile.– Alvin Liang
Nov 20 at 11:25
2
@Shaw No,
#include <stdlib.h>
or#include <cstdlib>
should goes to *.cc, not Makefile– Alvin Liang
Nov 20 at 11:28
2
Thanks Alvin and Zanna. You guys are awesome. I included the #include <stdlib.h> in util.cc and other files,which solved the problem.
– Shah
Nov 20 at 11:43
Related on Stack Overflow
– Zanna
Nov 20 at 12:37