RE: [Dev-C++] what is a resource? how do I create my own headers?
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ioannis V. <no...@ya...> - 2001-01-04 23:50:25
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...]On Behalf Of Luc Morin > Sent: Friday, January 05, 2001 1:29 AM > To: dev...@li... > Subject: Re: [Dev-C++] what is a resource? how do I create my own headers? > > While I do agree that this will protect agaisnt multiple _inclusion_, it > will > NOT protect agaisnt multiple _definition_ of a function located > in a header > file. > > The #ifdef/#endif only works for the current compile. So, if you include > a header file that contains a definition in more than one translation unit > (.cpp file), you will get multiple definitions of the function, which is > gonna > be flagged as an error by the linker. I agree with you, but why create many definitions in many cpp files? Except of that, you can use #ifndef at definitions too (it is called "conditional compilation"). Anyway, if i remember well we were talking about definitions included in the header file, not external source code files (where as i said we can use conditional compilation too). Friendly, Ioannis * Ioannis Vranos * Programming pages: http://members.nbci.com/noicys * Alternative URL: http://run.to/noicys |