求教,怎样使用StdAfx.h?
c++吧
全部回复
仅看楼主
level 11
gameloftyou 楼主
有时创建工程时可以自动生成,不过我想手动添加,如何做?
比如:
=================================
StdAfx.h头文件内容:
#pragma once
#include <windows.h>
=================================
StdAfx.cpp文件内容:
#include "StdAfx.h"
=================================
主文件内容:
#include "StdAfx.h"
#include <objidl.h>
#include <gdiplus.h>
#pragma comment(lib,"Gdiplus.lib")
==================================
为什么编译时却出了问题:
main.cpp(1): fatal error C1854: cannot overwrite information formed during creation of the precompiled header in object file: 'd:\my documents\visual studio 2010\projects\gdiplus\gdiplus\release\main.obj'
[转圈哭]

2012年08月31日 15点08分 1
level 11
gameloftyou 楼主
已解决,StdAfx.cpp属性要设置为Create/Yc,其它使用StdAfx.h的cpp要设置为Use/Yu
2012年09月01日 00点09分 2
level 9
受教了。。虽然不懂。。
2012年09月01日 05点09分 3
1