From: Dan Chak Newsgroups: comp.os.msdos.djgpp Subject: making programs modular Date: Sun, 17 May 1998 23:02:57 -0400 Organization: Erol's Internet Services Lines: 31 Message-ID: <355FA4E1.C3E90E7D@erols.com> NNTP-Posting-Host: 207-172-228-62.s62.as1.wtr.erols.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk I have never written programs in a very modular sense, but wanted to try and start now. However, I am having the following problem: I have files bj.cc and options.cc I put them both in the project. Both files need to include a third file "fxtools.h" which has #ifndef's &c. Now, when I try to compile, during the linking, it tells me that everything defined in fxtools.h is being redefined, even though it has #ifndef's. When I used to just include options.h from bj.cc (and have everything from options.cc in options.h -- not the greatest programming practice, I know..) I would have no problems with linking because the #ifndef's were working properly. Now what's gone wrong? How do I get around this? I thought writing code more modularly was going to make things easier, not harder! Thanks, Dan /'^'\ ( o o ) --------------------------------------------------oOOO--(_)--OOOo-- Daniel Chak chakster AT geocities DOT com http://members.xoom.com/chakster .oooO ( ) Oooo. ----------------------------------------------------\ (----( )--- \_) ) / (_/