My sample.c program:
#include <stdio.h>
int main()
{
printf(“Hello, World!\n”);
return 0;
}
When I want compile it, I see this error (as root):
cd ~/Desktop
x86_64-w64-mingw32-gcc sample.c -o file.exe
Output:
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
I can't compile any C format file. How can I fix it?
Note: It cross compiles to Windows, thus "file.exe".