I need to compile some older c data acquisition code with a cpp compiler. I am running into trouble using signal( ).
Currently I have the following:
signal(SIGINT, close_datalog);
signal(SIGTERM, close_datalog);
With close_datalog() defined the following way:
void close_datalog()
{
..do stuff here
exit(1);
}
I am encountering the following error when I try to compile the program using my makefile:
g++ -c -o xdatalog.o xdatalog.cpp
xdatalog.cpp: In function ‘int main(int, char**)’:
xdatalog.cpp:108:26: error: invalid conversion from ‘void (*)()’ to ‘__sighandler_t {aka void (*)(int)}’ [-fpermissive]
Any help would be greatly appreciated. I am fairly new to cpp.