Re: Preprocessor, nested files etc.
From: Florian (wizard_oz_at_gmxREMOVEUPPERCASE.net)
Date: 08/13/04
- Next message: Florian: "Re: Preprocessor, nested files etc."
- Previous message: Paul Mensonides: "Re: Boost Workshop at OOPSLA 2004"
- In reply to: Karl Heinz Buchegger: "Re: Preprocessor, nested files etc."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 13 Aug 2004 14:34:41 GMT
Danke Heinz,
That makes sense now. I just didn't know that in C++ each cpp file is it's
on unit, like Ali said. Thanks a lot for clarifying this, that will make
troubleshooting a bit easier in the future.
Flo
"Karl Heinz Buchegger" <kbuchegg@gascad.at> wrote in message
news:411C76CF.FB80288D@gascad.at...
> Florian wrote:
>>
>> 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?
>
> Each source code file (each *.cpp) is compiled independently of all
> others.
> That's the way things work in C++.
> And of course it makes sense. Your project consists of 10 files. The
> project
> I am involved in, consists of more then 400 files. Consider I make a
> change
> in one of them and the compiler is going to recompile everything
> (sometimes
> we have to do this, it takes around 2 hours for a complete recompile).
>
> When the compiler compiles a *.cpp file, it starts in a fresh state.
> Nothing
> it has learned by compiling a previous source code file remains. Which is
> a good thing, because it means it can compile a collection of *.cpp files
> in any order it likes. If you make a change in one of them, only this file
> needs to be recompiled and the linker will form a new executable from the
> results of all the copilation steps (they are called 'object files' or
> 'machine
> code files')
>
> --
> Karl Heinz Buchegger
> kbuchegg@gascad.at
- Next message: Florian: "Re: Preprocessor, nested files etc."
- Previous message: Paul Mensonides: "Re: Boost Workshop at OOPSLA 2004"
- In reply to: Karl Heinz Buchegger: "Re: Preprocessor, nested files etc."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|