warning: implicit declaration of function 'kill'

前端 未结 2 1713
星月不相逢
星月不相逢 2021-02-13 12:32

I am making these inclusions:

#include 
#include 
#include 
#include 

But

相关标签:
2条回答
  • 2021-02-13 13:04

    You can also define it on the compile time by adding this flag with gcc.

    -D_POSIX_C_SOURCE
    

    ex:

    -g -D_POSIX_C_SOURCE -Wall -std=c99
    
    0 讨论(0)
  • 2021-02-13 13:08

    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>
    
    0 讨论(0)
提交回复
热议问题