Pelles C forum

C language => Beginner questions => Topic started by: nima on March 27, 2011, 09:56:58 PM

Title: In pelles c windows.h doesn't compile
Post by: nima on March 27, 2011, 09:56:58 PM
hi,
when I compile this code:

    #include <windows.h>
    #include <stdio.h>

    void main(void)
    {
       printf("Hello World");
    }

I get this error:

    D:\Program Files\PellesC\Include\Win\basetsd.h(53): error #2001: Syntax error: expected ';' but found 'INT64'.
    D:\Program Files\PellesC\Include\Win\basetsd.h(53): warning #2099: Missing type specifier; assuming 'int'.
    D:\Program Files\PellesC\Include\Win\basetsd.h(57): error #2120: Redeclaration of '__int64', previously declared at D:\Program Files\PellesC\Include\Win\basetsd.h(53); expected 'int' but found 'unsigned int'.
    D:\Program Files\PellesC\Include\Win\basetsd.h(57): error #2001: Syntax error: expected ';' but found 'UINT64'.
    D:\Program Files\PellesC\Include\Win\basetsd.h(57): warning #2099: Missing type specifier; assuming 'int'.
    D:\Program Files\PellesC\Include\Win\winnt.h(558): fatal error #1014: #error: "No target architecture".

thanks for your help.
Title: Re: In pelles c windows.h doesn't compile
Post by: CommonTater on March 28, 2011, 12:40:27 AM
In your project options/compiler ... enable microsoft extensions and pelles c extensions.

Also the correct form for main is .... int main (void) ... and it returns an error code, usually 0 at the end.


#include <stdio.h>

int main (void)
  {
    printf( "Hello World" );

    return 0;
   }
Title: Re: In pelles c windows.h doesn't compile
Post by: nima on March 28, 2011, 08:09:29 PM
Thanks :)