Settings | Sign in | Sign up

There are currently 2 posts.

【方法】给Visual Studio 2012工程添加预编译头

Floor 1 巨大八爪鱼 2/16/16 14:05

第一步:打开工程属性,选择“所有配置”,在配置属性->C/C++->预编译头中将预编译头设置为“使用(/Yu)”

Floor 2 巨大八爪鱼 2/16/16 14:13

第二步:给工程创建stdafx.h和stdafx.cpp文件,并在stdafx.cpp文件里写上:#include "stdafx.h"
第三步:在stdafx.cpp上点击右键打开属性,仍然要选择“所有配置”,在配置属性->C/C++->预编译头中将预编译头设置为“创建 (/Yc)”
第四步:重新编译整个工程


总的来说就是,工程中的stdafx.cpp要设置为“创建 (/Yc)”,其余的cpp文件都要设置为“使用(/Yu)”

Content converter:

Reply the post
Content:
User: You are currently anonymous.
Captcha:
Unclear? Try another one.
©2010-2025 Purasbar Ver3.0 [Mobile] [Desktop]
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported license.