Linking problem

I’m having trouble linking a simple class. I reduced the thing to a simple file, so I guess I must be missing something important.

I tried it in two computers (neither of them with conflicting compilers as far as I know), one with:
[ul]
RedHat 9.0
Root 3.05/07
gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
[/ul]

and the other with:
[ul]
RedHat 6.1
Root 3.10/02
gcc version 2.95.2 19991024 (release)
[/ul]

Here is a tar file with my things. It is so simple that I don’t know what I’m missing, and in the two computers it gives me different replies:

in the firs it says:

main.o(.gnu.linkonce.t._ZN6eventoC1Ev+0x19): In function `evento::evento[in-charge]()':
/usr/tools/root/pro/include/TObject.h:154: undefined reference to `vtable for evento'
evento.o(.text+0x22): In function `__static_initialization_and_destruction_0':
/home/jgonzalez/reconstruction/test/evento.cc:3: undefined reference to `ROOT::GenerateInitInstance(evento const*)'
collect2: ld returned 1 exit status

and in the second:

main.o: In function `ROOT::TDefaultInitBehavior type_info function':
main.cc:9: undefined reference to `evento::evento(void)'
evento.o: In function `ROOT::TDefaultInitBehavior type_info function':
evento.cc:3: undefined reference to `ROOT::GenerateInitInstance(evento const *)'
collect2: ld returned 1 exit status

test.tar.gz (21 KB)

Hi,

You did not generate the dictionary for the class evento.
You’ll need to write a linkdef file, to run rootcint and to
compile and link the dictionary.

Cheers,
Philippe.

Hi Philipe

Thanks. I did make the linkdef file but didn’t send it because for some reason I was not using it to link. I don’t know why. It makes sense.

I knew it had to be something stupid like this but couldn’t see it. Thanks

Javier