I am using Visual Studio 2010. Can someone tell me the steps to remove
'StdAfx.h' and what are the dreawbacks of removing such directive. I am
implementing .h, and .cpp files for a class. Not much code. Thanks!!
I selected Empty Project. Mistake1: I began the project without selecting Empty Project. Mistake2: I may have changed the project name. Do I need to clear previous files for Mistakes 1 and 2?
Empty Project is not the key, when you create your project, before clicking on finish, go into the application settings and uncheck "Precompiled Header", You will no longer need to #include "stdafx.h" in your source files.
1) Right click on StdAfx.h in your Solution Explorer and select "Remove".
2) Select Delete to permanently delete the file
3) Remove all #include "StdAfx.h" statements.
4) Right click on your project in the Solution Explorer and select "Properties".
5) Navigate through Configuration Properties > C/C++ > Precompiled Headers and select "Not Using Precompiled Headers".
Edit: These steps apply if you have an existing project. The steps above describe how to avoid this when creating a new project.