警告:函数'杀'的隐式声明 [英] warning: implicit declaration of function 'kill'

查看:124
本文介绍了警告:函数'杀'的隐式声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在做这些夹杂物:

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

但仍然得到此警告。

But still getting this warning.

推荐答案

您可能正在传递-ansi -Wall切换到gcc编译器。
您可以删除-ansi如果你不需要它,否则尝试设置适当的功能定义宏。

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.

是这样的:

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

这篇关于警告:函数'杀'的隐式声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆