stdafx.h should be the first header file in all of the cpp files in your project. If you don't want to add it to your cpp file, then right-click on the file in the solution explorer, select properties then go to C++ -> precompiled headers and set it to off (it only affects that file).