hyperknot
hyperknot

Reputation: 13986

Why does Visual Studio 2010 create precompiled header files even if I don't ask for it?

I have Visual Studio 2010 with SP1 installed. I want to create a simple Win32 console application in C++.

I click New Project \ Win32 Console Application

There I click Console Application, no for "Empty project", no for "Precompiled header", no for "ATL" and "MFC".

The wizard looks like this:

dialog

Now, if I click finish, I end up with a project like this:

project

But why? I don't want precompiled headers, all I want is a very basic Win32 console application to practise learning C++.

Upvotes: 10

Views: 4390

Answers (2)

Puppy
Puppy

Reputation: 147008

Those headers aren't pre-compiled, they're pre-generated. Pre-compiled headers have the .pch extension and are pre-compiled versions of your own user headers. If you don't want them, then you need to click "Empty Project".

Upvotes: 6

Benjamin Lindley
Benjamin Lindley

Reputation: 103741

They're not precompiled header files unless they are compiled with the appropriate compiler flags(Yc to create the pch, and Yu to use it). If you check the Precompiled Header checkbox, those flags are set by default on all files added to the project. If you don't check it, they are not.

If you don't want any files generated, check Empty project.

Upvotes: 9

Related Questions