DD不是monkey 2022-05-15 23:07 采纳率: 0%
浏览 554

ubuntu gcc时缺少wrapper头文件怎么解决?

如题
以下是源代码
#include"wrapper"

int main()
{
pid_t pid;
int x = 1;
pid=fork();
if(pid == 0){
x=x+1;
printf("child:x=%d\n",x);
}
if(pid > 0){
x=x-1;
printf("parent:x=%d\n",x);
}
sleep(10);
}

img

  • 写回答

1条回答 默认 最新

  • 赵4老师 2022-05-16 11:23
    关注

    #include"wrapper"
    改为
    #include <stdio.h>
    #include <sys/types.h>
    #include <unistd.h>

    评论

报告相同问题?

问题事件

  • 修改了问题 5月15日
  • 创建了问题 5月15日