compile errors using signal.h in Linux [duplicate] compile errors using signal.h in Linux [duplicate] c c

compile errors using signal.h in Linux [duplicate]


It will work if you remove -ansi from your compile line. I suspect the problem is that the posix parts of the signal library aren't included when you specify -ansi.

If you really don't want to disable -ansi, you can also add -D_POSIX_C_SOURCE to the compiler options.

Here is a short discussion of ANSI and the gcc feature test macros.