简体   繁体   中英

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:

对话

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

项目

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

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM