首页 > 编程语言 > 详细

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

时间:2019-09-05 12:10:26      阅读:259      评论:0      收藏:0      [点我收藏+]

明明已经加了头文件

#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.

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

原文:https://www.cnblogs.com/tid-think/p/11464721.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!