0

I'm using Visual Studio 2015. I always uncheck "Precompiled header" whenever I create a new project, but Visual Studio still creates the file and adds it to my project. I've tried just creating an empty project, but that also gets rid of the external dependencies, which I need for my projects.

I've tried searching the internet but couldn't find anything about this. Is there a way to prevent Visual Studio from generating stdafx.h but keep the rest of the core libraries at project creation?

Kash
  • 51
  • 1
  • 7
  • IIRC, stdafx.h is not a precompiled header; it's a plain old header file. The precompiled headers have an extension of `.pch`. (It's been quite a while, so the extension may be slightly different; the first letter after the dot is a *p*, and the last letter of the extensions is *h*. Not certain about the middle letter.) – Ken White Feb 25 '16 at 04:09
  • @KenWhite: In Visual Studio's project generator, `stdafx.h` is the header which is compiled into `stdafx.pch`. – MSalters Feb 25 '16 at 09:26

3 Answers3

1

Haven't used VS since 2010 but from what I recall you cant get rid of stdafx.h as thats the standard way VS makes a non-empty project for you (it might be just winapp projects, console projects did not have it in VS2010). It wants you to place all your includes into there. Your best bet is to create an empty project and manage the dependencies yourself. Its not too bad.

Vans S
  • 1,743
  • 3
  • 21
  • 36
0

Try creating an empty project and place your important libraries manually. I don't think you can start VS non-empty project without a header file.

0

Just create an Empty Project.

The External Dependencies "folder" in the Solution Explorer will populate itself as you start including external dependencies.

When you create a Win32 Console Application, the External Dependencies will be prepopulated with a handful of headers at first; this is because the Win32 Console Application project includes a few source files that include external headers. When you create an Empty Project, the External Dependencies will be empty at first because there are no external dependencies yet.

James McNellis
  • 348,265
  • 75
  • 913
  • 977