2

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 

Makefile changes

Zanna
  • 72,312

1 Answers1

5

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.