You haven't linked with the gdi32 library. Try re-creating your project as a 'windows application' which should ensure the necessary libraries are properly linked. It will also provide you with the source code for a basic window.