delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/07/19:55:59

Date: Sun, 7 Dec 1997 19:49:37 -0500
From: Joe Davidson <dream_acres AT compuserve DOT com>
Subject: Help with C++ header files.
Sender: Joe Davidson <dream_acres AT compuserve DOT com>
To: "djgpp AT delorie DOT com" <djgpp AT delorie DOT com>
Message-ID: <199712071949_MC2-2B1A-31BE@compuserve.com>
MIME-Version: 1.0

I'm rather new to header files so I need some help.
I've written a small program that declars some classes and then tests their
functions.  When I had it all in a single .cc file, the program compiled
and worked fine.  Now I am trying to organize it and expand it, so I put
the class definitions in one file, foo.h,
and the member functions in another file, foo.cc.  I then made sure that I
put #include "foo.h" in my main.cc, and #include "foo.h" in my foo.cc file.
 
Also in my foo.h file I put
#ifndef foo_h
#define foo_h
//includes and code
#endif
Now when I compile it, it says that my class functions are declared more
than once.  What could be causing this problem?  I have looked through
source code written for Borlands compiler and I am doing nothing diffrent
as far as the definitions go.  I am using Rhide 1.4 as my editor under
Windows 95.

Please respond back to <dream_acres AT compuserve DOT com> as I do not subscribe
to the mailing list.  

Thank you,
Joe Davidson

- Raw text -


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