Originally Posted by
parad0x13
I just don't get it... I included -lopengl32 to the linker parameters and I even changed the setup.h file to allow opengl use. However all I did was change the value in the setup.h file and not recompile anything, seeing I don't know how
if anyone could shed some light on this mess I would be more than ecstatic... thanks!
That's it then, you do have to recompile after changing the header file- otherwise wxGLCanvas just isn't there no matter what you do. That said, I did recompile, there are some pretty thorough instructions in various places, including the Code::Blocks wiki, the library recompiled without a hitch, yet when I try to compile an example program to demonstrate wxGLCanvas, I too get linker errors, though of a different sort:
Code:
obj\Debug\wxSimpleGLMain.o||In function `ZN8GLCanvasC2EP7wxFrameRK6wxSizePi':|
C:\Documents and Settings\Mischa\My Documents\Programming\wxSimpleGL\wxSimpleGLMain.cpp|49|undefined reference to `_imp___ZN10wxGLCanvasC2EP8wxWindowiPiRK7wxPointRK6wxSizelRK8wxStringRK9wxPalette'|
C:\Documents and Settings\Mischa\My Documents\Programming\wxSimpleGL\wxSimpleGLMain.cpp|51|undefined reference to `_imp___ZN11wxGLContextC1EP10wxGLCanvasPKS_'|
C:\Documents and Settings\Mischa\My Documents\Programming\wxSimpleGL\wxSimpleGLMain.cpp|51|undefined reference to `_imp___ZN10wxGLCanvasD2Ev'|
obj\Debug\wxSimpleGLMain.o||In function `ZN8GLCanvasC1EP7wxFrameRK6wxSizePi':|
C:\Documents and Settings\Mischa\My Documents\Programming\wxSimpleGL\wxSimpleGLMain.cpp|49|undefined reference to `_imp___ZN10wxGLCanvasC2EP8wxWindowiPiRK7wxPointRK6wxSizelRK8wxStringRK9wxPalette'|
C:\Documents and Settings\Mischa\My Documents\Programming\wxSimpleGL\wxSimpleGLMain.cpp|51|undefined reference to `_imp___ZN11wxGLContextC1EP10wxGLCanvasPKS_'|
C:\Documents and Settings\Mischa\My Documents\Programming\wxSimpleGL\wxSimpleGLMain.cpp|51|undefined reference to `_imp___ZN10wxGLCanvasD2Ev'|
obj\Debug\wxSimpleGLMain.o||In function `ZN8GLCanvas5paintER12wxPaintEvent':|
C:\Documents and Settings\Mischa\My Documents\Programming\wxSimpleGL\wxSimpleGLMain.cpp|63|undefined reference to `_imp___ZNK10wxGLCanvas10SetCurrentERK11wxGLContext'|
C:\Documents and Settings\Mischa\My Documents\Programming\wxSimpleGL\wxSimpleGLMain.cpp|70|undefined reference to `_imp___ZN10wxGLCanvas11SwapBuffersEv'|
obj\Debug\wxSimpleGLMain.o||In function `Z41__static_initialization_and_destruction_0ii':|
C:\Documents and Settings\Mischa\My Documents\Programming\wxSimpleGL\wxSimpleGLMain.cpp|36|undefined reference to `_imp___ZN10wxGLCanvas13sm_eventTableE'|
obj\Debug\wxSimpleGLMain.o||In function `ZNK12wxWindowBase11GetBestSizeEv':|
C:\SourceCode\Libraries\wxWidgets-2.8.9\include\wx\window.h:(.rdata$_ZTV8GLCanvas[vtable for GLCanvas]+0x8)||undefined reference to `wxGLCanvas::GetClassInfo() const'|
C:\SourceCode\Libraries\wxWidgets-2.8.9\include\wx\window.h:(.text$_ZN8GLCanvasD1Ev[GLCanvas::~GLCanvas()]+0x16)||undefined reference to `_imp___ZN10wxGLCanvasD2Ev'|
C:\SourceCode\Libraries\wxWidgets-2.8.9\include\wx\window.h:(.text$_ZN8GLCanvasD0Ev[GLCanvas::~GLCanvas()]+0x16)||undefined reference to `_imp___ZN10wxGLCanvasD2Ev'|
I'm admittedly very much a n00b when it comes to C and C++, I can usually figure out compiler errors, but linker errors confound me, I can't tell if I've missed something, or if the example program is bad, but I'm more inclined to think I'm doing something wrong... I have linked to opengl32, glu32, and of course the appropriate wxwidgets library- I'm able to compile other wxwidgets programs since rebuilding it, but nothing with wxGLCanvas