在pelles c中,windows.h无法编译

nim*_*ima 2 c header-files pelles-c

我正在使用pelles c.当我编译这段代码时:

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

void main(void)
{
   printf("Hello World");
}
Run Code Online (Sandbox Code Playgroud)

我收到此错误:

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".
Run Code Online (Sandbox Code Playgroud)

谢谢你的帮助.

nim*_*ima 13

为了使用windows.hPellesC你必须去:

  • 项目 - >项目选项 - >编译器
  • 检查:启用Microsoft Extensions