I am trying to compile a very simple C program. Installed MinGW using auto installer, then added C:\MinGW\bin on my environment variable.
test.c
#include <stdio.h>
int main()
{
printf("Hello");
return 0;
}
When I compile this:
gcc test.c -o test.exe
But I got this error,
test.c: In function ‘main’: test.c:5:12: warning: character constant
too long for its type [enabled by defau lt] test.c:5:5: warning:
passing argument 1 of ‘printf’ makes pointer from integer w ithout a
cast [enabled by default]
c:\mingw\bin../lib/gcc/mingw32/4.6.2/../../../../include/stdio.h:294:37:
note: expected ‘const char *’ but argument is of type ‘int’
Pardon for being noob, trying to learn something worthy. Thanks!
The error message that you are getting matches exactly the error message that GCC would generate for the following code:
That is the double quotes got replaced with single quotes.
Use notepad or better Notepad++ to check what is going on.