Reputation: 6733
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.
Upvotes: 2
Views: 6602
Reputation: 6733
In order to use windows.h
in PellesC
you have to go to:
Upvotes: 14
Reputation: 1
int main(void)
and not void main(void)
return(0);
just before your last bracket. You must include this or you will get a syntax error because your program does not know when to stop running.Then do the following
Project
then scroll down and select `Project Options.Compiler
tab and make sure that the Calling conv:
box has _cdecl
selected.linker
tab and make sure that in the subsystem
box the type is set to Console
.Try building it again and see what happens!
Upvotes: -2
Reputation: 78915
You're missing some #define
s which other compilers (e.g. Visual Studio) always define. They provide essential information about the processor architecture, the OS version, the SDK version etc.
It's probably best to look up the Microsoft documentation about what macros their compiler defines and do the same.
This page could be a good starting point.
Upvotes: 0