compile errors using signal.h in Linux [duplicate]

给你一囗甜甜゛ 提交于 2019-12-04 23:15:49

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.

Please try moving "sys/types.h" before "signal.h".

If that doesn't work, try adding this:

#include <bits/sigaction.h>

If it still doesn't work, please specify:

1) Your OS and version

2) Your gcc version

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!