int main()
{
}
$ nm toto.o
00000000 T _Z4totoi
$ nm titi.o
00000000 B _Z4totoi
00000000 T main
$ g++-3.0 toto.o titi.o
titi.o(.bss+0x0): multiple definition of `toto(int)'
toto.o(.text+0x0): first defined here
/usr/bin/ld: Warning: size of symbol `toto(int)' changed from 5 to 4 in titi.o
/usr/bin/ld: Warning: type of symbol `toto(int)' changed from 2 to 1 in titi.o
collect2: ld returned 1 exit status
[^] # Re: symboles ?
Posté par Benoît Sibaud (site web personnel) . En réponse à la dépêche GCC 3.0.2 est disponible. Évalué à 1.
int _Z4totoi;
int main()
{
}
$ nm toto.o
00000000 T _Z4totoi
$ nm titi.o
00000000 B _Z4totoi
00000000 T main
$ g++-3.0 toto.o titi.o
titi.o(.bss+0x0): multiple definition of `toto(int)'
toto.o(.text+0x0): first defined here
/usr/bin/ld: Warning: size of symbol `toto(int)' changed from 5 to 4 in titi.o
/usr/bin/ld: Warning: type of symbol `toto(int)' changed from 2 to 1 in titi.o
collect2: ld returned 1 exit status