Mail Archives: djgpp/1997/05/29/22:35:26
The NiBBLeR (bws AT pop DOT telebyte DOT nl) wrote:
: Here's the source:
[snipped]
: Compiling this, isn't any problem.
: When linking it, it gives the error something like:
: -name::test(int c) defined on another place,
From the looks of the source, what you posted was a header file (.h) to be
#included in C++ source files. If you #include it in more than one C++
file, the mmeber functions will be multiply defined and you get the error
you paraphrased. The solution in this case is to write an extra C++ file
which #includes the header with the class definition, and move the member
function definitions from the header file into this new C++ file. Then you
compile this C++ file and link it in.
--
George Foot <mert0407 AT sable DOT ox DOT ac DOT uk>
Merton College, Oxford
- Raw text -