'StdAfx.h'

Apr 6, 2012 at 2:25pm
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?
Last edited on Apr 6, 2012 at 3:00pm
Apr 6, 2012 at 2:50pm
When you make a new project, select Empty Project from the list.
Apr 6, 2012 at 3:40pm
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.
Apr 6, 2012 at 3:42pm
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.
Last edited on Apr 6, 2012 at 3:45pm
Topic archived. No new replies allowed.