网页学习体会

  • 首页
  • 个人博客
您的位置: 首页  >  IT文章  >  ubuntu 编译C++ error: ‘syscall’ was not declared in this scope

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

分类: IT文章 • 2025-01-03 11:20:49

明明已经加了头文件

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

编译还是报错

error: ‘syscall’ was not declared in this scope

参考https://blog.****.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
  • C++类出现了E:\434\main.cpp|25|error: 'as' was not declared in this scope|,该如何解决
  • 解决Cygwin编译cocos2dx 遇到的 error: 'UINT64_C' was not declared in this scope 问题
  • 用g++ 编译 ffmpeg 编译出现 error: 'UINT64_C' was not declared in this scope 或 missing -D__STDC_CONSTANT_MACROS
  • ubuntu编译提示/usr/include/c++/7/cmath:1208:11 error ‘:round’ has not been declared
  • 已签名的apk文件或签名文件获取MD5值
  • 解决boa网页操作出现502 Bad Gateway The CGI was not CGI/1.1 compliant的一种可能
    网站免责声明 网站地图 最新文章 用户隐私 版权申明
本站所有数据收集于网络,如果侵犯到您的权益,请联系网站进行下架处理。   

Copyright © 2018-2021   Powered By 网页学习体会    备案号:   粤ICP备20002247号