[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

wxwindows and vtable



Whenever I compile any wx windows code that I've written I get a
missing vtable error as such, code first, error second. Any ideas on
what I'm doing wrong?


------------------------------------------------------------------------
#ifndef _DISP_H_
#define _DISP_H_

class wxDisp: public wxFrame
{
public:
    wxDisp();
    ~wxDisp();

    void setpixel(aint x, aint y, acolor c);
    acolor getpixel(aint x, aint y);
    void setrange(afloat nmin, afloat nmax);

    //vector<acolor> pixels;
    afloat min, max;

private:
    DECLARE_EVENT_TABLE()
};

#endif

------------------------------------------------------------------------
#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif

#include "wx/wx.h"

#include "../include/constants.h"
#include "../include/acolor.h"
#include "../include/wxDisp.h"

BEGIN_EVENT_TABLE(wxDisp, wxFrame)
END_EVENT_TABLE()

wxDisp::wxDisp():
    wxFrame(NULL, -1, "render", wxPoint(0,0), wxSize(800,600),
wxDEFAULT_FRAME_STYLE)
{
    Show();
};

------------------------------------------------------------------------
Building source directory of the Project: render ...
make
if g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/lib/wx/include/gtk-2.4
-DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES
 -Wall -g  -MT wxDisp.o -MD -MP -MF ".deps/wxDisp.Tpo" \
  -c -o wxDisp.o `test -f 'wxDisp.cc' || echo './'`wxDisp.cc; \
then mv -f ".deps/wxDisp.Tpo" ".deps/wxDisp.Po"; \
else rm -f ".deps/wxDisp.Tpo"; exit 1; \
fi
/bin/sh ../libtool --mode=link g++ -Wall -g    -o render  main.o
wxDisp.o -pthread -lwx_gtk-2.4
g++ -Wall -g -o render main.o wxDisp.o  -pthread -lwx_gtk-2.4
wxDisp.o(.text+0x119): In function `wxDisp::wxDisp[not-in-charge]()':
/home/e2/Projects/render/src/wxDisp.cc:20: undefined reference to
`vtable for wxDisp'
wxDisp.o(.text+0x271): In function `wxDisp::wxDisp[in-charge]()':
/home/e2/Projects/render/src/wxDisp.cc:20: undefined reference to
`vtable for wxDisp'
collect2: ld returned 1 exit status
make: *** [render] Error 1
Completed ... unsuccessful
Total time taken: 6 secs



Reply to: