ubuntu 编译C++ error: ‘syscall’ was not declared in this scope

明明已经加了头文件

#include <sys/syscall.h>
#include <sched.h>
#include <sys/resource.h>

 

编译还是报错

error: ‘syscall’ was not declared in this scope

参考https://blog.csdn.net/kl222/article/details/17025367

ubuntu中syscall定义是放在头文件unistd.h中的。

再添加头文件unistd.h即可

#include <unistd.h> 

编译ok

posted on 2021-12-09 19:16  lydstory  阅读(228)  评论(0)    收藏  举报

导航