APUE练习的时候
编译的时候老是报警,说是未定义 SA_INTERRUPT
jasonleaster@ubuntu:/Ad_Pro_in_Unix/chapter_10$ cc ./pro_10_22.c
./pro_10_22.c: In function ‘main’:./pro_10_22.c:30:21: error: ‘SA_INTERRUPT’ undeclared (first use in this function)
./pro_10_22.c:30:21: note: each undeclared identifier is reported only once for each function it appears in
纠结了半天,发现是头文件的问题,不要用apue.h,并且一定要include <setjmp.h>
可能是冲突的原因。这里不要include <apue.h>
而是include <setjmp.h>
就可以了。编译正常
本文解决了在编译过程中遇到的SA_INTERRUPT未定义错误。通过调整头文件包含顺序,即去掉apue.h并加入setjmp.h,成功避免了编译警告。
4万+

被折叠的 条评论
为什么被折叠?



