Re: [Dev-C++] Compilation of multiple files
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Jan M. <jan...@vo...> - 2007-07-13 12:25:49
|
Thank you very much boys & boys. I am a little bit better C-er again. Jan Mura ----- Original Message ----- From: "Jonathan Winterflood" <jon...@gm...> To: "Per Westermark" <pw...@ia...> Cc: "Jan Mura" <jan...@vo...>; <dev...@li...> Sent: Tuesday, July 10, 2007 6:43 PM Subject: Re: [Dev-C++] Compilation of multiple files > Indeed, the preprocessor directives you use aren't well placed: > > Firstly: > You use > #ifndef __stdio_h__ > #include<stdio.h> > #define __stdio_h__ > #endif > in your files as to not include stdio.h multiple times. > however, stdio.h (and any properly built .h file) already deals with this > issue (mostly the same way you did): > > something.h: > #ifndef __something_h__ > // > // body of something.h > // > #define __something_h__ > #endif > > source and header files using something.h: > #include "something.h" > > Secondly: > This mecanism only prevents the multiple inclusion of the .h > file on the same compilation run, but every .c file is compiled seperately > and then linked together to save effort (imagine recompiling a 300+ file > project (or even a 10-file one) just to change one small thing in one file > :D ) > > Jonathan > > > > __________ Informace od NOD32 2391 (20070711) __________ > > Tato zprava byla proverena antivirovym systemem NOD32. > http://www.nod32.cz > |