开发者

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

I've successfully installed M$ VC2010 and sta开发者_运维技巧rt 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???


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


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


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

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


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.


When you create your project, create an empty project.

For now, you can disable it in Project Settings.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜