www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/17/23:18:01

From: Dan Chak <chakster AT erols DOT com>
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
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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! <grin>
 
Thanks,
Dan                                                    /'^'\
                                                      ( o o )
--------------------------------------------------oOOO--(_)--OOOo--

  Daniel Chak
  chakster AT geocities DOT com
  http://members.xoom.com/chakster                 .oooO
                                                   (   )   Oooo.
----------------------------------------------------\ (----(   )---
                                                     \_)    ) /
                                                           (_/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019