Invalid use of undefined type 'class BButton'

Here’s a screen dump of some code and some errors that I don’t quite understand. What am I doing wrong?

My code is afaicansee for all intents and purposes identical to the example code from the programming the BeOS book. I’m not missing any includes (which the error seems to suggest to me?) and I triplechecked for typos but I’m still missing something apparently.

EDIT - It appears I need to #include <Button.h>, but none of the sample code does that? Of course, that gives me the same error, but still… is the code wrong or is it something else?

hrmm … I define my BMessages like this:-

const uint32 TOOLBAR_BTN_HELP = ‘Tbhp’;

Unless I miss my guess, it’s because it’s fairly old code. Sometimes when I look over someone’s code which was written for R3, R4, or R4.5, some of the includes just don’t work quite right because the headers have changed over the course of OS releases. If you add the #include <Button.h>, you’ll be OK.

I’m reading that Programming BeOS book which I think is R4 code (97ish?), I was just hoping it didn’t make much of a difference.