warning: implicit declaration of function 'kill'

Ramy Al Zuhouri picture Ramy Al Zuhouri · Apr 3, 2012 · Viewed 17.4k times · Source

I am making these inclusions:

#include <signal.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>

But still getting this warning.

Answer

dAm2K picture dAm2K · Apr 3, 2012

You are probably passing the "-ansi -Wall" switches to the gcc compiler. You can remove "-ansi" if you don't need it, otherwise try to set the proper feature define macro.

Something like:

#define _POSIX_SOURCE
#include <sys/types.h>
#include <signal.h>
#include <unistd.h>
#include <sys/wait.h>