Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
移动了标准C头文件,如stdio.h,破坏了安装_C_Gcc_Clang - Fatal编程技术网

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

移动了标准C头文件,如stdio.h,破坏了安装,c,gcc,clang,C,Gcc,Clang,我试图解决emscripten的clang安装问题,为此我(愚蠢地)绕过了某些C头文件,如stdio.h。 我重新安装了gcc和libc6,但没有解决问题,因此我甚至无法编译hello world程序,如: #include<stdio.h> int main() { printf("hello world\n"); return 0; } #包括 int main(){ printf(“hello world\n”); 返回0; } 这给了我一个错误 In fil

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

#include<stdio.h>
int main() {
   printf("hello world\n"); 
   return 0;
}
#包括
int main(){
printf(“hello world\n”);
返回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’
在hello.c:1:0:/usr/include/stdio.h:20:3中包含的文件中:错误:
#错误“从不直接包含;请改用。”
#错误“从不直接包含;请改用。”
c:在函数“main”中:
你好,c:4:1:警告:
函数“printf”的隐式声明
[-Wimplicit函数声明]printf(“hello world\n”);
hello.c:4:1:警告:内置函数的隐式声明不兼容
函数“printf”
hello.c:4:1:注意:包括“”或提供
“printf”声明

尝试删除您移动的所有标题,以便只保留gcc中的标题。您使用的是哪个Linux发行版?