home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / cplus / 19022 < prev    next >
Encoding:
Text File  |  1993-01-12  |  1.3 KB  |  39 lines

  1. Newsgroups: comp.lang.c++
  2. 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
  3. From: jabraham@acs.ucalgary.ca (John Abraham)
  4. Subject: c++.newbie has problem with mult. #includes
  5. Sender: news@acs.ucalgary.ca (USENET News System)
  6. Message-ID: <93Jan12.172129.20662@acs.ucalgary.ca>
  7. Date: Tue, 12 Jan 93 17:21:29 GMT
  8. Nntp-Posting-Host: acs6.acs.ucalgary.ca
  9. Organization: The University of Calgary, Alberta
  10. Lines: 27
  11.  
  12. I have two classes, meplannode and emme2node.  Each of them is
  13. derived from the base class node.
  14.  
  15. I want to use both of them in a file scope, so I #include "meplan.h" and
  16. "emme2.h".  Problem - both of them #include "node.h", so I get
  17. multiple definition errors for the node class.  What do I do?
  18.  
  19. It seems pretty kludgy to put:
  20. #ifndef _classname
  21. ...
  22. ...
  23. ...
  24. #define _classname
  25. #endif
  26. around every single .h file.
  27.  
  28. Is this a common problem?  Am I missing something obvious?
  29.  
  30.  
  31. -- 
  32. John E. Abraham                       ***** University of Calgary
  33. jabraham@acs.ucalgary.ca               **** Department of Civil Engineering
  34. Mathematical Modelling                  *** 2500 University Dr. N.W.
  35. Computer Simulation                      ** Calgary, AB, T2N 1N4
  36. Transportation and Land Use Interaction   * Canada
  37.  
  38.  
  39.