DIGIT-ARC read-only archive · snapshot: July 23, 2026

errors on building visual c++ program

2 posts · originally from https://geek.digit.in/community/threads/errors-on-building-visual-c-program.62099/

C
callmeastha Original post #1
Jul 4, 2007 at 5:36 PM
hey guys i'm learning visual c++ and i'm getting errors on building the following program.it's from a book and so i expected it to run but it's giving errors please tell me what they mean and how to get rid of them

code:
#include<windows.h>
int_stdcall WinMain ( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
MessageBox(0,"Hello!","title",0);
return(0);
}


error C2146: syntax error : missing ';' before identifier 'WinMain'

error C2501: 'int_stdcall' : missing storage-class or type specifiers

fatal error C1004: unexpected end of file found


p.s. i did not install msdn library. does that affect?
ilugd
ilugd #2
Jul 4, 2007 at 10:51 PM
msdn library should not be a problem. This most probably is a problem with the necessary file not being pointed out to the linker or a required header file not being referenced.
My vc++ skills are a bit rusty.