我是 C/Pro*C 的新手 我在Linux中编译了C代码。我收到以下错误。
/usr/include/sys/proc.h:560: error: conflicting types for 'exit'
/usr/include/sys/proc.h:560: error: conflicting types for 'exit'
在proc.h中,退出函数定义为
extern void exit(int, int);
header proc.h 是操作系统定义的 header ,我不知道为什么会出现此错误。
最佳答案
如果存在冲突的类型,它也可以在其他地方定义,可能使用不同的类型 - 要么作为具有不同签名的函数,要么作为变量。
检查是否是这种情况,如果是,请重命名您的变量。
关于c - 错误: conflicting types for 'exit' in OS header 'proc.h' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10975593/