Search code examples
cheader-filespelles-c

In pelles c windows.h doesn't compile


I'm using pelles c. 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.


Solution

  • In order to use windows.h in PellesC you have to go to:

    • Project -> Project Options -> Compiler
    • Check: Enable Microsoft Extensions