Preprocessor, nested files etc.
From: Florian (wizard_oz_at_gmxREMOVEUPPERCASE.net)
Date: 08/13/04
- Next message: Ali Cehreli: "Re: Preprocessor, nested files etc."
- Previous message: Flash Gordon: "Re: File seek"
- Next in thread: Ali Cehreli: "Re: Preprocessor, nested files etc."
- Reply: Ali Cehreli: "Re: Preprocessor, nested files etc."
- Reply: Ashes: "Re: Preprocessor, nested files etc."
- Reply: Ashes: "Re: Preprocessor, nested files etc."
- Reply: Karl Heinz Buchegger: "Re: Preprocessor, nested files etc."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 12 Aug 2004 22:17:26 GMT
Hi,
I'm hoping that someone can point me into the right direction here. I'm
trying to gain a bit of a better understanding on how the preprocessor
works - something that seems like a simple topic! I just keep running into
problems (Windows platform) because files are included in the wrong order,
one include file messes up the other one etc.. I think I need to brush up on
some basics here.
In this example project, I have several cpp files (~10) that all pretty much
include one common header file. In Visual Studio I turned the option on to
actually generate those pre-processed files - so that I could see what's
actually going on behind the scenes.
Well, I expected one big file but instead got one preprocessor file for each
of the cpp files in the project. OK, I suppose that this makes sense. One of
the things however I'm constantly trying to do is to prevent header files
from being included more than once - do I not need to worry about this when
it's included from different cpp files?
Also, when I #define macros and put them at the beginning of the header file
like
#ifndef HEADERFILE1_H
#define HEADERFILE1_H
...
..
#endif
then those macro definitions don't seem to stick. When the next cpp files is
being processed, the header file is being included again - even though the
macro was previously defined
Is this normal, and where am I getting confused?
Thanks!
Flo.
- Next message: Ali Cehreli: "Re: Preprocessor, nested files etc."
- Previous message: Flash Gordon: "Re: File seek"
- Next in thread: Ali Cehreli: "Re: Preprocessor, nested files etc."
- Reply: Ali Cehreli: "Re: Preprocessor, nested files etc."
- Reply: Ashes: "Re: Preprocessor, nested files etc."
- Reply: Ashes: "Re: Preprocessor, nested files etc."
- Reply: Karl Heinz Buchegger: "Re: Preprocessor, nested files etc."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|