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
New contributor
|
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
New contributor
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
2 days ago
1
Different compilers sometimes allow implicit exit() declaration. Just put#include <cstdlib>
into the cc files that fail to compile.
– Alvin Liang
2 days ago
2
@Shaw No,#include <stdlib.h>
or#include <cstdlib>
should goes to *.cc, not Makefile
– Alvin Liang
2 days ago
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
2 days ago
Related on Stack Overflow
– Zanna
2 days ago
|
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
New contributor
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
New contributor
New contributor
edited 2 days ago
Zanna
48.9k13123234
48.9k13123234
New contributor
asked 2 days ago
Shah
134
134
New contributor
New contributor
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
2 days ago
1
Different compilers sometimes allow implicit exit() declaration. Just put#include <cstdlib>
into the cc files that fail to compile.
– Alvin Liang
2 days ago
2
@Shaw No,#include <stdlib.h>
or#include <cstdlib>
should goes to *.cc, not Makefile
– Alvin Liang
2 days ago
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
2 days ago
Related on Stack Overflow
– Zanna
2 days ago
|
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
2 days ago
1
Different compilers sometimes allow implicit exit() declaration. Just put#include <cstdlib>
into the cc files that fail to compile.
– Alvin Liang
2 days ago
2
@Shaw No,#include <stdlib.h>
or#include <cstdlib>
should goes to *.cc, not Makefile
– Alvin Liang
2 days ago
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
2 days ago
Related on Stack Overflow
– Zanna
2 days ago
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
2 days ago
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
2 days ago
1
1
Different compilers sometimes allow implicit exit() declaration. Just put
#include <cstdlib>
into the cc files that fail to compile.– Alvin Liang
2 days ago
Different compilers sometimes allow implicit exit() declaration. Just put
#include <cstdlib>
into the cc files that fail to compile.– Alvin Liang
2 days ago
2
2
@Shaw No,
#include <stdlib.h>
or #include <cstdlib>
should goes to *.cc, not Makefile– Alvin Liang
2 days ago
@Shaw No,
#include <stdlib.h>
or #include <cstdlib>
should goes to *.cc, not Makefile– Alvin Liang
2 days ago
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
2 days ago
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
2 days ago
Related on Stack Overflow
– Zanna
2 days ago
Related on Stack Overflow
– Zanna
2 days ago
|
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 |
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 2 days ago
Carlos Dagorret
31814
31814
add a comment |
add a comment |
Shah is a new contributor. Be nice, and check out our Code of Conduct.
Shah is a new contributor. Be nice, and check out our Code of Conduct.
Shah is a new contributor. Be nice, and check out our Code of Conduct.
Shah is a new contributor. Be nice, and check out our Code of Conduct.
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
2 days ago
1
Different compilers sometimes allow implicit exit() declaration. Just put
#include <cstdlib>
into the cc files that fail to compile.– Alvin Liang
2 days ago
2
@Shaw No,
#include <stdlib.h>
or#include <cstdlib>
should goes to *.cc, not Makefile– Alvin Liang
2 days ago
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
2 days ago
Related on Stack Overflow
– Zanna
2 days ago