home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!haven.umd.edu!darwin.sura.net!gatech!destroyer!cs.ubc.ca!unixg.ubc.ca!kakwa.ucs.ualberta.ca!acs.ucalgary.ca!jabraham
- From: jabraham@acs.ucalgary.ca (John Abraham)
- Subject: c++.newbie has problem with mult. #includes
- Sender: news@acs.ucalgary.ca (USENET News System)
- Message-ID: <93Jan12.172129.20662@acs.ucalgary.ca>
- Date: Tue, 12 Jan 93 17:21:29 GMT
- Nntp-Posting-Host: acs6.acs.ucalgary.ca
- Organization: The University of Calgary, Alberta
- Lines: 27
-
- 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?
-
-
- --
- John E. Abraham ***** University of Calgary
- jabraham@acs.ucalgary.ca **** Department of Civil Engineering
- Mathematical Modelling *** 2500 University Dr. N.W.
- Computer Simulation ** Calgary, AB, T2N 1N4
- Transportation and Land Use Interaction * Canada
-
-
-