Author Topic: Drawing with wxClientDC / using OpenGL  (Read 4983 times)

himaja

  • Guest
Drawing with wxClientDC / using OpenGL
« on: July 23, 2006, 05:59:38 pm »

Hi,

I am trying to create a graph on a notebook using the wxClientDC, or, failing that, use openGL to draw the graph. Is there any sample that might explain the usage of wxClientDC? I would really appreciate it. Also, I tried compiling the sample opengl programs that come with wxWidgets, and I get a lot of errors. I recompiled codeblocks with the GLCANVAS and OPENGL values set to 1, and I still get these errors. The log is given below:

--------------------------------------------------------------------------------
mingw32-g++.exe -LC:/wxWidgets-2.6.2/lib/gcc_dll -LC:/MinGW/lib -LC:/wxWidgets-2.6.2/lib/codeblocks -o C:/wxWidgets-2.6.2/samples/opengl/cube/cube.exe .objs/cube.o     -lwxmsw26 -lwxmsw26 -lopengl32 -lglu32 -lglut32 -mwindows
.objs/cube.o(.text+0x1d59):cube.cpp: undefined reference to `_imp___ZN10wxGLCanvasC2EP8wxWindowPKS_iRK7wxPointRK6wxSizelRK8wxStringPiRK9wxPalette'
.objs/cube.o(.text+0x1df1):cube.cpp: undefined reference to `_imp___ZN10wxGLCanvasC2EP8wxWindowPKS_iRK7wxPointRK6wxSizelRK8wxStringPiRK9wxPalette'
.objs/cube.o(.text+0x1e92):cube.cpp: undefined reference to `_imp___ZN10wxGLCanvasC2EP8wxWindowPK11wxGLContextiRK7wxPointRK6wxSizelRK8wxStringPiRK9wxPalette'
.objs/cube.o(.text+0x1f38):cube.cpp: undefined reference to `_imp___ZN10wxGLCanvasC2EP8wxWindowPK11wxGLContextiRK7wxPointRK6wxSizelRK8wxStringPiRK9wxPalette'
.objs/cube.o(.text+0x1f96):cube.cpp: undefined reference to `_imp___ZN10wxGLCanvasD2Ev'
.objs/cube.o(.text+0x1fcc):cube.cpp: undefined reference to `_imp___ZN10wxGLCanvasD2Ev'
.objs/cube.o(.text+0x2002):cube.cpp: undefined reference to `_imp___ZN10wxGLCanvasD2Ev'
.objs/cube.o(.text+0x20b0):cube.cpp: undefined reference to `_imp___ZN10wxGLCanvas10SetCurrentEv'
.objs/cube.o(.text+0x25f7):cube.cpp: undefined reference to `_imp___ZN10wxGLCanvas11SwapBuffersEv'
.objs/cube.o(.text+0x26ca):cube.cpp: undefined reference to `_imp___ZN10wxGLCanvas6OnSizeER11wxSizeEvent'
.objs/cube.o(.text+0x26ff):cube.cpp: undefined reference to `_imp___ZN10wxGLCanvas10SetCurrentEv'
.objs/cube.o(.text+0x273f):cube.cpp: undefined reference to `_imp___ZN10wxGLCanvas10SetCurrentEv'
.objs/cube.o(.text+0x2b33):cube.cpp: undefined reference to `_imp___ZN10wxGLCanvas10SetCurrentEv'
.objs/cube.o(.text+0x417e):cube.cpp: undefined reference to `_imp___ZN10wxGLCanvas13sm_eventTableE'
.objs/cube.o(.rdata$_ZTV12TestGLCanvas[vtable for TestGLCanvas]+0x8):cube.cpp: undefined reference to `wxGLCanvas::GetClassInfo() const'
collect2: ld returned 1 exit status
mingw32-make.exe: *** [C:/wxWidgets-2.6.2/samples/opengl/cube/cube.exe] Error 1
Process terminated with status 1 (0 minutes, 0 seconds)
15 errors, 0 warnings
 
I would really appreciate it if someone could tell me what I am doing wrong.

Thanks!
Himaja.

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Drawing with wxClientDC / using OpenGL
« Reply #1 on: July 23, 2006, 06:40:41 pm »
wxClientDC is used in the following samples: caret, docview, docvwmdi, dragimag, drawing, joytest, mdi, mfc, richedit, sashtest and scroll.

About the OpenGL one... it should have created another DLL (so you should have libwxmsw26 and another one I don't know its name that should begin with libwx). You need to add both to the list of libraries to link. A quick guess is you should add it before wxmsw26.

himaja

  • Guest
Re: Drawing with wxClientDC / using OpenGL
« Reply #2 on: July 23, 2006, 10:58:43 pm »
The OpenGL apps are working perfectly now!!!
Thank you!!!
Himaja.