Is there any way to use VC++ 2010 without including stdafx.h?
Asked Answered
E

5

5

I've successfully installed M$ VC2010 and start writing simple programs using it.

I am very annoyed from the #include<stdafx.h>, So is there any way to compile and run programs without it???

Equilateral answered 26/5, 2010 at 3:31 Comment(5)
Is it really still cool to spell it with a dollar sign?Haynor
Precompiled headers can speed up build times a lot - you might find it even more annoying waiting three times as long for your build to complete...Beet
About M$, ya, I don't like it, so I call it M$Equilateral
It's amazing to read "M$" right on the day Apple surpasses Microsoft market cap.Immesh
So, we can find a new name of apple too :)Equilateral
E
10

It's for pre-compiled headers. Don't use pre-compiled headers, don't include it.

Evacuate answered 26/5, 2010 at 3:33 Comment(0)
A
6

Goto Project Settings->Precompiled Headers. Select Not using precompiled headers.

Aggress answered 26/5, 2010 at 3:37 Comment(0)
R
6

You can also turn off precompiled headers per file.

Setting this in VS Express C++ 2012 is as follows:

  1. In Project Explorer right-click on .cpp file, select Properties.
  2. On the left pane select Configuration Properties/C++/ Precompiled Headers
  3. Now, on the right pane there is 'Precompiled Header' value which you can change from Use /Yu to :
    • 'Not Using Precompiled Headers'

Cheers enter image description here

Rattan answered 22/5, 2014 at 16:44 Comment(0)
D
4

Of course, just go to Project Settings, C/C++ → Precompiled Headers, and choose "Not Using Precompiled Headers".

BTW: On large projects using precompiled headers may significantly decrease build time.

Darin answered 26/5, 2010 at 3:39 Comment(0)
V
2

When you create your project, create an empty project.

For now, you can disable it in Project Settings.

Velasco answered 26/5, 2010 at 3:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.