Hi everyone,
I’m trying to compile root tutorial programs in order to run them as shell commands.
I tried the way I use to compile macros: g++ name.C -o name root-config --glibs --cflags --libs
of course after changing the name of the main function in the macro to int main() .
It didn’t work (I should have known it wouldn’t be that easy) . With the file “listBox.C” located in $ROOTSYS/tutorials/gui/ , I get this error :
/tmp/ccrKvOh5.o: In function MyMainFrame::IsA() const': listBox.C:(.text._ZNK11MyMainFrame3IsAEv[MyMainFrame::IsA() const]+0xf): undefined reference to
MyMainFrame::Class()’
/tmp/ccrKvOh5.o:(.rodata._ZTV11MyMainFrame[vtable for MyMainFrame]+0xe8): undefined reference to MyMainFrame::ShowMembers(TMemberInspector&, char*)' /tmp/ccrKvOh5.o:(.rodata._ZTV11MyMainFrame[vtable for MyMainFrame]+0xec): undefined reference to
MyMainFrame::Streamer(TBuffer&)’
/tmp/ccrKvOh5.o:(.rodata._ZTV11MyMainFrame[vtable for MyMainFrame]+0x2d4): undefined reference to non-virtual thunk to MyMainFrame::ShowMembers(TMemberInspector&, char*)' /tmp/ccrKvOh5.o:(.rodata._ZTV11MyMainFrame[vtable for MyMainFrame]+0x2d8): undefined reference to
non-virtual thunk to MyMainFrame::Streamer(TBuffer&)'
collect2: ld returned 1 exit status
the only thing I changed is the name of the main function.
What am I missing? I looked over the net to find a tutorial on how to compile those macros but i couldn’t find out any help.
Thanks,
Max