Here is my very basic code:
#include <stdio.h>
int main (void);
{
printf("Hello world. \n");
return 0;
}
and here are my error messages:
Building work.obj.
C:\Users\Taylor\Documents\Pelles C Projects\Assignment one.exe\work.c(3): error #2156: Unrecognized declaration.
C:\Users\Taylor\Documents\Pelles C Projects\Assignment one.exe\work.c(4): warning #2099: Missing type specifier; assuming 'int'.
C:\Users\Taylor\Documents\Pelles C Projects\Assignment one.exe\work.c(4): error #2001: Syntax error: expected ')' but found 'string constant'.
C:\Users\Taylor\Documents\Pelles C Projects\Assignment one.exe\work.c(4): error #2120: Redeclaration of 'printf', previously declared at C:\Program Files\PellesC\Include\stdio.h(171); expected 'int __cdecl function(const char *, ...)' but found 'int __cdecl function()'.
C:\Users\Taylor\Documents\Pelles C Projects\Assignment one.exe\work.c(5): error #2156: Unrecognized declaration.
C:\Users\Taylor\Documents\Pelles C Projects\Assignment one.exe\work.c(5): error #2156: Unrecognized declaration.
C:\Users\Taylor\Documents\Pelles C Projects\Assignment one.exe\work.c(6): error #2156: Unrecognized declaration.
*** Error code: 1 ***
Done.
It's almost like stdio.h was wiped clean or something. What can I do?
What project type did you use to initialize this?
.exe
Try to compile this:
#include <stdio.h>
int main (void)
{
printf("Hello world. \n");
return 0;
}
Wow that was easy lol. Thanks for the help.
Quote from: taytay on September 25, 2009, 06:14:31 PM
#include <stdio.h>
int main (void);
{
printf("Hello world. \n");
return 0;
}
of course it will not compile correctly..
(see that ";" at the end of the second line? it means that this line is just a function prototype declaration and not a function header)