Try upgrading to a newer version of Visual Studio. Even if it doesn't fix your problem, it's probably a good idea anway since there are newer versions available.
I had the same problem. I followed these steps.(im using 2010 express) and now its working fine.
1. click new project
2. select 'Win32 console application'
3. enter a project name
4. Uncheck 'Create a directory for solution' option
5. click ok
6. A win32 application wizard will pop-up
7. click 'next'
8. Select console application under application type(usually it is selected by default)
9. select 'empty project' under additional options
10. all other options should be unchecked
11. Click finish project
Mostly this should work.
If the problem still persists, there should be errors in your code which compiler coudlnt find.
Run always with administrator rights