Undefined reference to BApplication
I am trying to compile the code at the bottom of the post, but when I do it says: Undefined reference to BApplication
// file: funkyapp.h class FunkyApplication : public BApplication { public: FunkyApplication(); }; // file: funkyapp.cpp #include <Window.h> #include <Application.h> #include "funkyapp.h" int main() { // create a new FunkyApplication (inherited from BApplication) object FunkyApplication myFunkyApplication; // enter the message loop myFunkyApplication.Run(); } // the constructor FunkyApplication::FunkyApplication() : BApplication("application/x-vnd.funkyapp") { // we cannot do BWindow myFunkyWindow(BRect(10,10,210,110), "Funky Title", B_TITLED_WINDOW, NULL ); // like we did with BApplication, because Show() will return immediately. If allocated on the // stack, the memory used by myFunkyWindow would be released while in use. BWindow* myFunkyWindow = new BWindow(BRect(10,10,210,110), "Funky Title", B_TITLED_WINDOW, NULL ); // make window visible myFunkyWindow->Show(); }

Comments
Re: Undefined reference to BApplication
you need to include on top in the header "funkyapp.h:
Re: Undefined reference to BApplication
Re: Undefined reference to BApplication
Sorry, I'm not quite sure what you mean about the includes, I tried reordering them (is that what you meant, I didn't think it was...):
// file: funkyapp.cpp #include "funkyapp.h" #include int main() { // create a new FunkyApplication (inherited from BApplication) object FunkyApplication myFunkyApplication; // enter the message loop myFunkyApplication.Run(); } // the constructor FunkyApplication::FunkyApplication() : BApplication("application/x-vnd.funkyapp") { // we cannot do BWindow myFunkyWindow(BRect(10,10,210,110), "Funky Title", B_TITLED_WINDOW, NULL ); // like we did with BApplication, because Show() will return immediately. If allocated on the // stack, the memory used by myFunkyWindow would be released while in use. BWindow* myFunkyWindow = new BWindow(BRect(10,10,210,110), "Funky Title", B_TITLED_WINDOW, NULL ); // make window visible myFunkyWindow->Show(); } // header // file: funkyapp.h #include class FunkyApplication : public BApplication { public: FunkyApplication(); };