In the definition of class MyMainFrame is forgotten
ClassDef (MyMainFrame, 0) to be included at the end
and probably it could be mention that dictionary must
be generated (I’m sorry if its written but I didn’t see it)
because the example is not running without it.
You can add a class without using the ClassDef macro that makes available the object I/O features of ROOT for your class. These specific features are not needed for the pointed example. About the missing advise for the dictionary generation you are right. Advanced users know that signals/slots in ROOT use the dictionary information but this is not obvious for beginners. I have already prepared a full example as given at: root.cern.ch/phpBB2/viewtopic.php?t=1525 and I will include it for the next edition.
[quote]bg[/quote] is maybe [quote]br[/quote] on page 351
Yes the ClassDef is not needed but you’ll get:
so it’s probably consistent to include ClassDef
Yes, ‘bg’ should be ‘br’ - I will fix that. Thank you for repoting it.
There was no error message at the time when this example was created. Some recent changes in root could show it up now. I will check that on Monday.
I see no error message compiling the example in both ways:
rootcint -f ex2aDict.cxx -c example2a.h ex2aLinkDef.h
g++ `root-config --cflags --glibs` -o example2a example2a.cxx ex2aDict.cxx
root  .x example2a.cxx++
Info in <TUnixSystem::ACLiC>: creating shared library /home/antcheva/sa_example/./example2a_cxx.so
rootcint -f example2bDict.cxx -c example2b.h example2bLinkDef.h
Error in <MyMainFrame>: MyMainFrame inherits from TObject but does not have its own ClassDef
I’m sorry I didn’t mention the problem is in the inheritance example 2b (or not 2b:)
…and its not
ClassDef (MyMainFrame, 0) as in the first post but
ClassDef (MyMainFrame, 1)(to be precise)
Your very first message pointed to the example2a in chapter 24, page 339 (the subject of your posting). About the example2b you are right about the current status: the error message appears and having ClassDef makes it disappear. This was not a case before (both examples were created in 2003).
No problem. Thanks for reporting the error for the example2b.