Bonjour,
j'ai l'erreur suivante :

[Linker Error] undefined reference to `vtable for GL_Window'
[Linker Error] undefined reference to `vtable for GL_Window'
[Linker Error] undefined reference to `vtable for GL_Window'
[Linker Error] undefined reference to `vtable for GL_Window'
ld returned 1 exit status
H:\C++\tp wxwidget opengl\Makefile.win [Build Error] exe: *** [Output/MingW/tp wxWidgets opengl.exe] Error 1

avec ce code :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <wx/wx.h>
#include <wx/glcanvas.h>
 
class GL_Window : public wxGLCanvas
{
    wxFrame* parent ;
 
        public:
        GL_Window(wxFrame* parent, wxWindowID id, const wxPoint & pos, const wxSize & size, long style,
                  const wxString & name,
                  int * attribList ,
                  const wxPalette& palette);
        virtual ~GL_Window(){}
};
 
GL_Window::GL_Window(wxFrame* parent, wxWindowID id, const wxPoint & pos, const wxSize & size, long style,
                  const wxString & name,
                  int * attribList,
                  const wxPalette& palette)
                  :wxGLCanvas(parent, id, attribList,pos, size, style, name, palette)
{
       parent = new wxFrame(0,
       id,
        "Window", wxDefaultPosition, wxDefaultSize, 0, name);
 
}
 
 
int main(int argc, char **argv)
{
       wxFrame *truc=NULL ;
       GL_Window monGL_Window(truc, -1, wxDefaultPosition, wxDefaultSize, 0, _T("GL_Canvas"), 0, wxNullPalette) ;
       return 0 ;
}