User forums > Help
wxGLCanvas link errors (C::B 10.05)
venom_zx:
i want to make use of OpenGL using the wxGLCanvas control/class, but whenever i create a clean wxWidgets project and just drop wxGLCanvas ( without any other changes ) onto my frame based application with wxSmith i get these link errors:
obj\Release\opengltestMain.o:opengltestMain.cpp|| undefined reference to `_imp___ZN10wxGLCanvasC1EP8wxWindowiRK7wxPointRK6wxSizelRK8wxStringPiRK9wxPalette'|
obj\Release\opengltestMain.o:opengltestMain.cpp|| undefined reference to `_imp___ZN10wxGLCanvasC1EP8wxWindowiRK7wxPointRK6wxSizelRK8wxStringPiRK9wxPalette'|
||=== Build finished: 2 errors, 0 warnings ===|
i've built wxMSW with mingw using:
mingw32-make.exe -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=0 USE_OPENGL=1
afterwards i went and changed "setup.h" in my "<WXWIN>\lib\gcc_dll\msw\wx" directory:
replaced: #define wxUSE_GLCANVAS 0
with: #define wxUSE_GLCANVAS 1
my project is using linking to "libwxmsw28.a" (by default). also linking "libwxmsw28_gl.a" did not help.
i've tried this with wxMSW 2.8.10 and also 2.8.11.
i'm on windows xp using codeblocks-10.05mingw-setup
am i doing something wrong?
oBFusCATed:
Does these two libs define the missing symbols (probably no)?
The way to check is this:
nm libwxmsw28.a | grep _imp___ZN10wxGLCanvasC1EP8wxWindowiRK7wxPointRK6wxSizelRK8wxStringPiRK9wxPalette
or
nm libwxmsw28.a > result.txt then open the file in a text editor and search for _imp___ZN10wxGLCanvasC1EP8wxWindowiRK7wxPointRK6wxSizelRK8wxStringPiRK9wxPalette
Biplab:
I believe your wx-opengl library was not built correctly.
The problem is that when you issue USE_OPENGL=1 to make it doesn't change the setup.h file. Result is that the dll generated by makefile doesn't export any functions. Even though one changes wxUSE_GLCANVAS to 1, binary generated previously doesn't have any exported functions. So you'll get linker error if you try to link against that dll. See the following ticket where I had provided patch to fix this issue.
--- Quote ---http://trac.wxwidgets.org/ticket/10832
--- End quote ---
Solution is -
1) Change #define wxUSE_GLCANVAS 1 in setup.h file.
2) Then rebuild the wxWidgets binary or at least recompile wxOpenGl source & rebuild wxOpengl dll.
venom_zx:
thanks! (after linking to "libwxmsw28_gl.a") that fixed the problem Biblab
ollydbg:
BTW:
There is a wiki of the full details, see here:
Compiling wxWidgets 2.8.9 Monolithic Build with openGL for Windows
Navigation
[0] Message Index
[#] Next page
Go to full version