Why do I get all those mult. defin errors

Scott slary61@maine.edu
Thu Oct 14 04:34:00 GMT 1999


You are right, that was a typo.  The proper command line  is:

gcc -g -o CopyAlias CopyAlias.c

I solved the problem by uninstalling anything that had to do with egcs
and everything that had to do with gdb.  This made X unusable.  Then I
reinstalled everything I'd taken off from command line.  

I don't know enough about it to know why it works, but now  I get no
more errors.

Scott

Arthur Gold wrote:
> 
> Scott wrote:

> > Ok, so here is the whole thing.
> > Any help would be appreciated.
> >
> > cd /home/scott/
> > gcc -g CopyAlias CopyAlias.c
> What are you trying to accomplish with the above?
> Perhaps you _meant_ to say "cc -g -o CopyAlias CopyAlias.c"?
> Basically what's happening is that it's trying to link CopyAlias.o (the
> result of
> compiling CopyAlias.c) with the file CopyAlias, which would be the same
> thing...hence
> _every_ global will show up twice.
> 
> HTH,
> --ag
> > CopyAlias: In function `_init':
> > CopyAlias(.init+0x0): multiple definition of `_init'
> > /usr/lib/crti.o(.init+0x0): first defined here
> > CopyAlias(.text+0x0): multiple definition of `_start'
> > /usr/lib/crt1.o(.text+0x0): first defined here
> > CopyAlias: In function `__stat':
> > /usr/src/bs/BUILD/glibc/io/stat.c:44: multiple definition of `_fini'
> > /usr/lib/crti.o(.fini+0x0): first defined here
> > CopyAlias: In function `__stat':
> > /usr/src/bs/BUILD/glibc/io/stat.c:44: multiple definition of
> > `_GLOBAL_OFFSET_TABLE_'
> > /usr/lib/crti.o(.got.plt+0x0): first defined here
> > CopyAlias: In function `__stat':
> > /usr/src/bs/BUILD/glibc/io/stat.c:44: multiple definition of
> > `_IO_stdin_used'
> > /usr/lib/crt1.o(.rodata+0x4): first defined here
> > CopyAlias: In function `__stat':
> > /usr/src/bs/BUILD/glibc/io/stat.c:44: multiple definition of
> > `__data_start'
> > /usr/lib/crt1.o(.data+0x0): first defined here
> > /tmp/ccc6YMEy.o: In function `main':
> > /home/scott/CopyAlias.c:16: multiple definition of `flag_all'
> > CopyAlias:/usr/src/bs/BUILD/glibc/io/stat.c:44: first defined here
> > /tmp/ccc6YMEy.o: In function `main':
> > /home/scott/CopyAlias.c:16: multiple definition of `flag_same'
> > CopyAlias:/usr/src/bs/BUILD/glibc/io/stat.c:44: first defined here
> > /tmp/ccc6YMEy.o: In function `main':
> > /home/scott/CopyAlias.c:16: multiple definition of `flag_link'
> > CopyAlias:/usr/src/bs/BUILD/glibc/io/stat.c:44: first defined here
> > /tmp/ccc6YMEy.o: In function `main':
> > /home/scott/CopyAlias.c:16: multiple definition of `main'
> > CopyAlias(.text+0xb0): first defined here
> > /tmp/ccc6YMEy.o: In function `file_tester':
> > /home/scott/CopyAlias.c:104: multiple definition of `file_tester'
> > CopyAlias(.text+0x2a8): first defined here
> > /usr/lib/crti.o(.dynamic+0x0): multiple definition of `_DYNAMIC'
> > CopyAlias:/usr/src/bs/BUILD/glibc/io/stat.c:44: first defined here
> > collect2: ld returned 1 exit status
> >
> > Compilation exited abnormally with code 1 at Fri Oct  8 22:22:15
> 
> --
> Artie Gold, Austin, TX
> mailto:agold@bga.com or mailto:agold@cs.utexas.edu
> --
> Pet peeve: "its" = belonging or pertaining to "it" | "it's" = "it is"


More information about the Gcc-help mailing list