移动标准的C头文件,如stdio.h,打破了安装

时间:2017-06-15 07:12:19

标签: c gcc clang

我试图修复我的emscripten的clang安装问题,我(愚蠢地)移动了某些C头文件,如stdio.h。 我重新安装了gcclibc6,但它没有解决问题,因此我甚至无法编译hello world程序,如:

#include<stdio.h>
int main() {
   printf("hello world\n"); 
   return 0;
}

这给了我错误

In file included from hello.c:1:0: /usr/include/stdio.h:20:3: error:
#error "Never include <bits/stdio.h> directly; use <stdio.h> instead."
#error "Never include <bits/stdio.h> directly; use <stdio.h> instead." 
hello.c: In function ‘main’:

hello.c:4:1: warning:
implicit declaration of function ‘printf’
[-Wimplicit-function-declaration]  printf("hello world\n");

hello.c:4:1: warning: incompatible implicit declaration of built-in
function ‘printf’ 
hello.c:4:1: note: include ‘<stdio.h>’ or provide a
declaration of ‘printf’

0 个答案:

没有答案