@#$%^& Stroustrup

Greetings. I am working on his beginner's book, "Programming Principles and Practice using c++. Like many others by the look of things, I am trying to get his FLTK interface up and running, without much success.

The FLTK side of things went fine, no problems there to speak of. I am trying to get the first example of his Graphics interface (Chapter 12.3) up and running. I have posted a snippet below, there is much more code if people want to see it.

1
2
3
4
5
6
7
8
9
10
11
#include "Simple_window.h"
#include "Graph.h"

int main ()
{
    using namespace Graph_lib;
    Point tl {100,100};
    Simple_window win {tl, 600, 400, "Canvas"};
    
    win.wait_for_button();
}

    struct Button : Widget {
        Button(Point xy, int w, int h, const string& label, Callback cb)
            : Widget(xy,w,h,label,cb)
        {}

        void attach(Window&);
    };


when I try to compile it, I get the following error message...

undefined reference to `vtable for Graph_lib::Button'|

Anyways, this problems I guess falls into the category "messy", but I look forward to working with anyone who wants to take it on.


p.s. I am using Code::Blocks with the latest from MinGW, on Windows XP
Last edited on
https://gcc.gnu.org/faq.html#vtables

There's a missing function definition in there somewhere.
(It might not be your fault.)
The error message was reported twice. first for line 3 and second for line 1, if that tells you anything.

1
2
3
4
5
6
7
    struct Button : Widget {
        Button(Point xy, int w, int h, const string& label, Callback cb)
            : Widget(xy,w,h,label,cb)
        {}

        void attach(Window&);
    };
It looks like Button is failing to implement some pure virtual methods from Widget.
Topic archived. No new replies allowed.