NO

Author Topic: In pelles c windows.h doesn't compile  (Read 3798 times)

nima

  • Guest
In pelles c windows.h doesn't compile
« 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.

CommonTater

  • Guest
Re: In pelles c windows.h doesn't compile
« Reply #1 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.

Code: [Select]
#include <stdio.h>

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

     return 0;
    }
« Last Edit: March 28, 2011, 12:44:20 AM by CommonTater »

nima

  • Guest
Re: In pelles c windows.h doesn't compile
« Reply #2 on: March 28, 2011, 08:09:29 PM »
Thanks :)