Re: Putting #ifndef #endif around #include "StdAfx.h" causes problem
From: Mihajlo Cvetanovic (mac_at_RnEeMtOsVeEt.co.yu)
Date: 01/18/05
- Next message: Seb: "Pb with Active X Windows Media Player"
- Previous message: Kelvin: "use CFtpConnection on very slow connection"
- In reply to: Doug Harrison [MVP]: "Re: Putting #ifndef #endif around #include "StdAfx.h" causes problem"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 18 Jan 2005 10:41:42 +0100
Doug Harrison [MVP] wrote:
> Mihajlo Cvetanovic wrote:
>
>>I actually put needed non-MFC #includes before stdafx so that everything
>>works in non-MFC non-pch projects. This makes sense only if the source
>>is non-MFC as well.
>
> Unless I'm missing something, it makes sense only if the source file in
> question is configured not to use precompiled headers. Otherwise, I expect
> your #includes will be ignored. I would try not to #include stdafx.h in that
> situation, because when I hear "stdafx.h", I think "precompiled headers".
Putting #includes before stdafx is a good way to inform a user (of a
source file) about what he needs to add to stdafx.h. Those #includes are
indeed ignored by compiler, but they're useful info for a user. Of
course a user should be familiar with the pch mechanism, since it won't
compile if some #include is missing in stdafx.h.
If a user does not use pch then she would just create dummy stdafx. Simple.
- Next message: Seb: "Pb with Active X Windows Media Player"
- Previous message: Kelvin: "use CFtpConnection on very slow connection"
- In reply to: Doug Harrison [MVP]: "Re: Putting #ifndef #endif around #include "StdAfx.h" causes problem"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|