VC中预编译头文件的放置问题

来源:爱站网时间:2021-02-12编辑:网友分享
用C++编写程序的时候需要放上预编文件,这可以避免重新编译,从而大大提高程序员的工作效率,今天就让爱站技术频道小编跟大家说说VC中预编译头文件的放置问题吧!

用C++编写程序的时候需要放上预编文件,这可以避免重新编译,从而大大提高程序员的工作效率,今天就让爱站技术频道小编跟大家说说VC中预编译头文件的放置问题吧!
如下:
file: stdafx.h

 

// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#ifndef _WIN32_WINNT        // Allow use of features specific to Windows XP or later.                  
#define _WIN32_WINNT 0x0501    // Change this to the appropriate value to target other versions of Windows.
#endif                       
#define WIN32_LEAN_AND_MEAN        // Exclude rarely-used stuff from Windows headers

 

 

 


// 各位注意,要想使用预编译效果的头文件要放这里。
#include
#include "xxx.h"

 

 

 


// TODO: reference additional headers your program requires here


在stdafx.cpp中保持不变即可,默认如下:

 

 

 


// stdafx.cpp : source file that includes just the standard includes
// CPPTestHelper.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file

VC中预编译头文件的放置问题大家应该都知道了吧,爱站技术频道推荐的知识一定能派上用场的,赶快来看看吧。

上一篇:C语言开发中强弱符号的使用技巧

下一篇:C++的多态性知识

您可能感兴趣的文章

相关阅读

热门软件源码

最新软件源码下载