This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Why do I get all those mult. defin errors
Scott wrote:
>
> Tim Prince wrote:
> >
> > >mention glibc
> >
> > >Any ideas what is wrong?
> >
> > About the only clue you've given is the mention of glibc. A possibility is that
> > you may have linked in a shared glibc more than once, but this is nothing more
> > than the guesswork you've asked for.
> > Tim Prince
> > tprince@computer.org
> 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"