Quote:
undefined reference to `WinMain@16'
This means that you have set up your project to be a Windows project, not a console project. It has nothing to do with your code, per se. A Windows project expects to find a WinMain rather than a main.

You can mess around with your compiler settings and eventually succeed in changing this, but your quickest way out is to start a new project, making sure it's a Console project. That would be Win32, Win32 Console Application, under the File/New/Project menu. Then, when you get to Application Settings, select Console Application, deselect "Precompiled Headers" and select "Empty Project".

After that's done, go to Project/Add/Add New Item/, Select Code and .cpp file. Copy your "main.cpp" file into that new file. Do the same for "header.cpp". Then do the same for "header.h", except choose Code and header (.h) file.

Compile and run your app.

Incidentally, choosing to use the names "main" and "header" is a rather sucky thing to do. Main is a generic function used for launching a C/C++ application, and header files are thick on the ground. Use something descriptive of the file's contents.