Mail Archives: djgpp/1997/12/10/17:01:16
A few days ago, I posted a message concerning header files and the response
I got said to take out all the code out of the header file, so I did that,
but I still get the same message, "multiple defintion of <function name>".
I tried writing a small program, and I sill got the same problem. Here is
the source code:
box.h-
#ifndef box_h
#define box_h // Chapter 5 - Program 7
class box {
int length;
int width;
public:
void set(int new_length, int new_width);
};
#endif
-------------------
box.cc-
#include "box.h"
#pragma implementation
// This method will set a box size to the two input parameters
void box::set(int new_length, int new_width) //the compiler complains
about this line.
{
length = new_length;
width = new_width;
}
In the main file, all I do is a #include "box.h"
Respond to me through mail at <dream_acres AT compuserve DOT com> because I don't
subscribe to the mailing list.
Thank You
Joe Davidson
- Raw text -