Re: [Dev-C++] Compilation of multiple files
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Jonathan W. <jon...@gm...> - 2007-07-10 16:44:06
|
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 |