home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!ux1.cso.uiuc.edu!cs.uiuc.edu!sparc0b!pjl
- From: pjl@cs.uiuc.edu (Paul Lucas)
- Subject: Re: c++.newbie has problem with mult. #includes
- Message-ID: <C0r7yp.A5r@cs.uiuc.edu>
- Sender: news@cs.uiuc.edu
- Organization: University of Illinois at Urbana-Champaign
- References: <93Jan12.172129.20662@acs.ucalgary.ca>
- Date: Tue, 12 Jan 1993 18:42:25 GMT
- Lines: 25
-
- In <93Jan12.172129.20662@acs.ucalgary.ca> jabraham@acs.ucalgary.ca (John Abraham) writes:
-
- >I have two classes, meplannode and emme2node. Each of them is
- >derived from the base class node.
-
- >I want to use both of them in a file scope, so I #include "meplan.h" and
- >"emme2.h". Problem - both of them #include "node.h", so I get
- >multiple definition errors for the node class. What do I do?
-
- >It seems pretty kludgy to put:
- >#ifndef _classname
- >...
- >...
- >...
- >#define _classname
- >#endif
- >around every single .h file.
-
- >Is this a common problem? Am I missing something obvious?
-
- No; that's the way everybody does it.
- --
- - Paul J. Lucas
- AT&T Bell Laboratories
- Naperville, IL
-