"multiply defined" error

Arthur Gold agold@bga.com
Sun Nov 14 19:30:00 GMT 1999


Emmanuel Lambert wrote:
> 
> Hi,
> 
> I compiled all my .cc files (including a file with main() ) with g++ -c
> This worked fine.
> Now, I want to fit everything together with g++ file1.o file2.o file3.o ....
> but this gives lots of errors, all the same.
> 
> The errors look like this :
> -----------------------------------------------------------
> ld: fatal: symbol `MCL::MCL(char *, char *, char *)' is multiply defined:
>         (file mcltrain.o and file mcl.o);
> -----------------------------------------------------------
> 
> Why is this ?
> 
> I DID include lines likes this in my files :
> 
> -----------------------------------------------------------
> #ifndef File1_h
> #define File1_h 0
make it #define File1_h
> 
> ...
> 
> #endif
> -----------------------------------------------------------
> 
> Please help me out.
> 
> Thank you!
> 
> Emmanuel Lambert

OK, we'll have to dig deeper. Show exactly what your commands were.

HTH,
--ag

-- 
Artie Gold, Austin, TX
mailto:agold@bga.com or mailto:agold@cs.utexas.edu
--
"If you come to a fork in the road, take it." L. P. Berra


More information about the Gcc-help mailing list