Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 833
nima Avatar asked Nov 27 '25 09:11

nima


1 Answers

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

  • Project -> Project Options -> Compiler
  • Check: Enable Microsoft Extensions
like image 52
nima Avatar answered Nov 29 '25 23:11

nima