I was sure I had selected console. Well it compiles fine if I copy paste it to another new project so I guess I must have checked it as win32 project. Thanks for the help.