To me stdafx.h and stdafx.cpp are both empty, can you post yours please?
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
// Modify the following defines if you have to target a platform prior to the ones specified below.
// Refer to MSDN for the latest info on corresponding values for different platforms.
#ifndef WINVER // Allow use of features specific to Windows XP or later.
#define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows.
#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.
#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
#ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later.
#define _WIN32_IE 0x0600 // Change this to the appropriate value to target other versions of IE.
#define _HAS_TR1 1
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
// TODO: reference additional headers your program requires here
Far from empty if you ask me.Code:
// stdafx.cpp : source file that includes just the standard includes
// Help.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file
In my hobby projects, I don't use precompiled headers for the very reason that I want to have all the includes needed for the project clearly visible in the C(++)-file, and not hidden inside some other file.
If both stdafx.cpp and stdafx.h are empty, then precompiled headers make absolutely no sense at all.
"turn off" you mean turn off pre-compiled header creation (/Yc) or turn off pre-compiled header using (/Yu)?
This conflicts with CornedBes's point in post #13, where he said the stdafx.h is empty. Any comments?
(BTW: I did search for stdafx.h and stdafx.cpp in my VC folder, and some of them are empty and some of them are not.)
I think whether or not pre-compiled header is used is decided by the compiler option /Yu, why do you think it is decided by whether the related header file is empty or not -- "the compiler sees the include of the empty stdafx.h as a directive to use stdafx.pch"