Write the program in C + +, must use the precompiled header file, is that
stdafx.h.
But I always thought that if you included stdafx.h in a. cpp file, you used the precompiled header file, but that's not true.
in VC + +, the precompiled header file refers to the header file placed in the stdafx.h to be effective.
are as follows:
File:stdafx.h
Copy Code code as follows:
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/appropriate value to target other versions of Windows.
#endif
#define WIN32_LEAN_AND_MEAN//Exclude rarely-used stuff from Windows headers
Copy Code code as follows:
Please note that the header file to use the precompiled effect should be placed here.
#include <Windows.h>
#include "xxx.h"
Copy Code code as follows:
Todo:reference Additional headers your program requires
In Stdafx.cpp, the default is the following:
Copy Code code as follows:
Stdafx.cpp:source file that includes just the standard includes
Cpptesthelper.pch'll be the pre-compiled header
StdAfx.obj would contain the pre-compiled type information
#include "stdafx.h"
Todo:reference any additional headers your need in STDAFX. H
And not in this file