MacArthur, Ian (SELEX GALILEO, UK) schrieb:
>> can reproduce "undefined reference to `vtable for GraphEngine'"
>> on Linux (2.6.18) with fltk-2.0.x-r5990
> 
> OK - I'd assumed it was an OSX specific probloem, but it's not... Just
> tried it on this winXP/mingw box, and yup, fails...
> 
>> commenting the destructor works !!!!
> 
> Indeed it does... So... There is something about destructors and such...
> Anybody? I used to know this stuff...

stupid me,
declaring a destructor with no implementation.
following compiles:

---------- test.cxx
// fltk2-config --use-gl --compile test.cxx
#include "fltk/Window.h"
#include <fltk/run.h>
#include <fltk/gl.h>
#include <fltk/GlWindow.h>

using namespace fltk;

class GraphEngine : public fltk::GlWindow
        {
public :
        GraphEngine(int X,int Y,int W,int H,const char*L=0)
                : fltk::GlWindow(X,Y,W,H,L)
                {}
        ~GraphEngine() {}
private:
        void draw()
                {      // Clear screen
                glClear(GL_COLOR_BUFFER_BIT);    // Draw white 'X'
                glColor3f(1.0, 1.0, 1.0);
                glBegin(GL_LINE_STRIP);
                glVertex2f(w(), h());
                glVertex2f(-w(),-h());
                glEnd();
                }
        };

int main(int argc, char **argv)
        {
        Window *window = new Window(700, 500, "Window Sample");
        window->begin();
        GraphEngine *engine = new GraphEngine (10, 150, 500, 350, 0);
        window->end();
        window->show();
        return fltk::run();
        }
------- EOF

can you see the difference ?
/me is always frightened by c++ error messages

greetings
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to