Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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++.

like image 634
hyperknot Avatar asked Jun 08 '11 17:06

hyperknot


2 Answers

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.

like image 62
Benjamin Lindley Avatar answered Sep 21 '22 08:09

Benjamin Lindley


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".

like image 28
Puppy Avatar answered Sep 19 '22 08:09

Puppy