C 程序没有在我的 kali 中编译 linux

C programs are not compiled in my kali linux

我的sample.c程序:

#include <stdio.h>

int main()
 {
 printf(“Hello World!\n”);
return 0;
 } 

所以当我想编译它时,我看到了这个错误:

root@Kali:~/Desktop# x86_64-w64-mingw32-gcc sample.c -o file.exe
sample.c: In function ‘main’:
sample.c:5:2: error: stray ‘2’ in program
sample.c:5:2: error: stray ‘0’ in program
sample.c:5:2: error: stray ‘4’ in program
sample.c:5:12: error: ‘Hello’ undeclared (first use in this function)
sample.c:5:12: note: each undeclared identifier is reported only once for each function it appears in
sample.c:5:18: error: expected ‘)’ before ‘World’
sample.c:5:18: error: stray ‘\’ in program
sample.c:5:18: error: stray ‘2’ in program
sample.c:5:18: error: stray ‘0’ in program
sample.c:5:18: error: stray ‘5’ in program

我无法编译任何 C 格式文件。请帮助我。

这要归功于您的编辑。 引号)和是不同的 导致错误。 尝试 " .

#include <stdio.h>

 int main()
 {
 printf("Hello World!\n");
 return 0;
  } 

试试其他代码编辑器。