public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* "multiply defined" error
@ 1999-11-14 15:30 Emmanuel Lambert
  1999-11-14 19:30 ` Arthur Gold
  1999-11-30 23:28 ` Emmanuel Lambert
  0 siblings, 2 replies; 4+ messages in thread
From: Emmanuel Lambert @ 1999-11-14 15:30 UTC (permalink / raw)
  To: help-gcc

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

...

#endif
-----------------------------------------------------------

Please help me out.

Thank you!

Emmanuel Lambert



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: "multiply defined" error
  1999-11-14 15:30 "multiply defined" error Emmanuel Lambert
@ 1999-11-14 19:30 ` Arthur Gold
  1999-11-30 23:28   ` Arthur Gold
  1999-11-30 23:28 ` Emmanuel Lambert
  1 sibling, 1 reply; 4+ messages in thread
From: Arthur Gold @ 1999-11-14 19:30 UTC (permalink / raw)
  To: help-gcc

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: "multiply defined" error
  1999-11-14 19:30 ` Arthur Gold
@ 1999-11-30 23:28   ` Arthur Gold
  0 siblings, 0 replies; 4+ messages in thread
From: Arthur Gold @ 1999-11-30 23:28 UTC (permalink / raw)
  To: help-gcc

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* "multiply defined" error
  1999-11-14 15:30 "multiply defined" error Emmanuel Lambert
  1999-11-14 19:30 ` Arthur Gold
@ 1999-11-30 23:28 ` Emmanuel Lambert
  1 sibling, 0 replies; 4+ messages in thread
From: Emmanuel Lambert @ 1999-11-30 23:28 UTC (permalink / raw)
  To: help-gcc

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

...

#endif
-----------------------------------------------------------

Please help me out.

Thank you!

Emmanuel Lambert



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1999-11-30 23:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-14 15:30 "multiply defined" error Emmanuel Lambert
1999-11-14 19:30 ` Arthur Gold
1999-11-30 23:28   ` Arthur Gold
1999-11-30 23:28 ` Emmanuel Lambert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).