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

时间:2015-04-02 21:05:05

标签: c gcc

我的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 ‘\342’ in program
sample.c:5:2: error: stray ‘\200’ in program
sample.c:5:2: error: stray ‘\234’ 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 ‘\342’ in program
sample.c:5:18: error: stray ‘\200’ in program
sample.c:5:18: error: stray ‘\235’ in program

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

1 个答案:

答案 0 :(得分:1)

这是由于你的编辑。 引号)和不同, < / strong>导致错误。 尝试使用

#include <stdio.h>

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

尝试其他代码编辑器。