我试图修复我的emscripten的clang安装问题,我(愚蠢地)移动了某些C头文件,如stdio.h
。
我重新安装了gcc
和libc6
,但它没有解决问题,因此我甚至无法编译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’