Ok… so I’ve been wanting to get my own custom app that uses opencascade, wxwidgets and linux code::blocks with eventual ports to windows. There is a very nice OSS application called heekscad that can be consulted for reference.
I believe to set up an Opengl window using wxwidgets WxGlCanvas is what I need. I found some non-occ sample code just to figure out how WxGlcanvas ticks. I found some references to it in HeeksCAD
[Edit.. Scroll to the bottom for what works… I was barking up a lot of wrong trees here.]
I think I need to explore Opengl a little bit before I go much further into the OCC stuff.
Actually, I think I need to back up a little further.
I loaded up the subclasswxglcanvas.cpp sample code and I’m getting the following errors:
obj/Debug/subclasswxglcanvas.o||In function
__static_initialization_and_destruction_0':|
wxEventHashTable::wxEventHashTable(wxEventTable const&)’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|26|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|28|undefined reference towxEVT_PAINT'|
wxEVT_NULL’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|28|undefined reference to
obj/Debug/subclasswxglcanvas.o||In function__tcf_1':|
wxEventHashTable::~wxEventHashTable()’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|26|undefined reference to
obj/Debug/subclasswxglcanvas.o||In functionmain':|
wxEntry(int&, char**)’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|95|undefined reference to
obj/Debug/subclasswxglcanvas.o||In functionwxCreateApp()':|
wxAppConsole::CheckBuildOptions(char const*, char const*)’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|95|undefined reference to
obj/Debug/subclasswxglcanvas.o||In functionwxGLCanvasSubClass::Render()':|
wxGLCanvas::SetCurrent()’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|51|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|52|undefined reference towxPaintDC::wxPaintDC(wxWindow*)'|
glClearColor’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|53|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|54|undefined reference toglClear'|
glViewport’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|55|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|57|undefined reference toglBegin'|
glColor3f’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|58|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|59|undefined reference toglVertex2f'|
glVertex2f’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|60|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|61|undefined reference toglVertex2f'|
glVertex2f’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|62|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|63|undefined reference toglColor3f'|
glVertex2f’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|64|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|65|undefined reference toglEnd'|
glBegin’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|67|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|68|undefined reference toglColor3f'|
glVertex2f’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|69|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|70|undefined reference toglVertex2f'|
glVertex2f’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|71|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|72|undefined reference toglVertex2f'|
glEnd’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|73|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|76|undefined reference toglColor4f'|
glutWireTeapot’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|77|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|79|undefined reference toglLoadIdentity'|
glColor4f’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|80|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|81|undefined reference toglutWireTeapot'|
glFlush’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|84|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|85|undefined reference towxGLCanvas::SwapBuffers()'|
wxGLCanvasSubClass’:|
obj/Debug/subclasswxglcanvas.o||In function
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|31|undefined reference towxNullPalette'|
wxDefaultSize’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|31|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|31|undefined reference towxDefaultPosition'|
wxGLCanvas::wxGLCanvas(wxWindow*, int, wxPoint const&, wxSize const&, long, wxString const&, int*, wxPalette const&)’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|31|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|33|undefined reference towxConvLibc'|
glutInit’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|41|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|42|undefined reference towxGLCanvas::~wxGLCanvas()'|
MyApp::OnInit()’:|
obj/Debug/subclasswxglcanvas.o||In function
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|100|undefined reference towxFrameNameStr'|
wxGLCanvasSubClass’:|
obj/Debug/subclasswxglcanvas.o||In function
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|31|undefined reference towxNullPalette'|
wxDefaultSize’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|31|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|31|undefined reference towxDefaultPosition'|
wxGLCanvas::wxGLCanvas(wxWindow*, int, wxPoint const&, wxSize const&, long, wxString const&, int*, wxPalette const&)’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|31|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|33|undefined reference towxConvLibc'|
glutInit’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|41|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|42|undefined reference towxGLCanvas::~wxGLCanvas()'|
wxStringBase::Init()’:|
obj/Debug/subclasswxglcanvas.o||In function
/usr/include/wx-2.8/wx/string.h|270|undefined reference towxEmptyString'|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 0 warnings ===|
I think I need to research this doc as to what is going on
The issue has to do with static and dynamic libraries where I found a reasonable explanation of the difference here:
This document pretty much explain what the problem is, only thing is I'm a little too tired have this sink in. Perhaps a quick read tonight and a re-read over a cup of coffee.
http://www.nsnam.org/docs/linker-problems.doc
Ok.. I forgot to save some stuff and I need to retrace my steps....
I copied subclasswxglcanvas.cpp from http://wiki.wxwidgets.org/WxGLCanvas and setup up code blocks
Build Options>Compiler Settings>Other options:wx-config –cxxflags
Build Options>Linker Settings>Other Linker Options>Other linker options: wx-config –libs
Ok... So when I do that I get this:
obj/Debug/subclasswxglcanvas.o||In function wxGLCanvasSubClass::Render()’:|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|51|undefined reference towxGLCanvas::SetCurrent()'|
glClearColor’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|53|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|54|undefined reference toglClear'|
glViewport’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|55|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|57|undefined reference toglBegin'|
glColor3f’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|58|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|59|undefined reference toglVertex2f'|
glVertex2f’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|60|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|61|undefined reference toglVertex2f'|
glVertex2f’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|62|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|63|undefined reference toglColor3f'|
glVertex2f’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|64|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|65|undefined reference toglEnd'|
glBegin’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|67|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|68|undefined reference toglColor3f'|
glVertex2f’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|69|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|70|undefined reference toglVertex2f'|
glVertex2f’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|71|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|72|undefined reference toglVertex2f'|
glEnd’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|73|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|76|undefined reference toglColor4f'|
glutWireTeapot’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|77|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|79|undefined reference toglLoadIdentity'|
glColor4f’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|80|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|81|undefined reference toglutWireTeapot'|
glFlush’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|84|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|85|undefined reference towxGLCanvas::SwapBuffers()'|
wxGLCanvasSubClass’:|
obj/Debug/subclasswxglcanvas.o||In function
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|31|undefined reference towxGLCanvas::wxGLCanvas(wxWindow*, int, wxPoint const&, wxSize const&, long, wxString const&, int*, wxPalette const&)'|
glutInit’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|41|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|42|undefined reference towxGLCanvas::~wxGLCanvas()'|
wxGLCanvas::wxGLCanvas(wxWindow*, int, wxPoint const&, wxSize const&, long, wxString const&, int*, wxPalette const&)’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|31|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|41|undefined reference toglutInit'|
wxGLCanvas::~wxGLCanvas()’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|42|undefined reference to
obj/Debug/subclasswxglcanvas.o:(.rodata+0xc8)||undefined reference towxGLCanvas::sm_eventTable'|
~wxGLCanvasSubClass’:|
obj/Debug/subclasswxglcanvas.o||In function
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|17|undefined reference towxGLCanvas::~wxGLCanvas()'|
wxGLCanvas::~wxGLCanvas()’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|17|undefined reference to
obj/Debug/subclasswxglcanvas.o:(.rodata._ZTV18wxGLCanvasSubClass[vtable for wxGLCanvasSubClass]+0x8)||undefined reference towxGLCanvas::GetClassInfo() const'|
wxGLCanvas::OnInternalIdle()’|
obj/Debug/subclasswxglcanvas.o:(.rodata._ZTV18wxGLCanvasSubClass[vtable for wxGLCanvasSubClass]+0x1d8)||undefined reference to
obj/Debug/subclasswxglcanvas.o:(.rodata._ZTI18wxGLCanvasSubClass[typeinfo for wxGLCanvasSubClass]+0x8)||undefined reference totypeinfo for wxGLCanvas'|
||=== Build finished: 39 errors, 0 warnings ===|
When I googled someone in the code:blocks forum with the same pain.
http://forums.codeblocks.org/index.php?topic=5769.0
So... I followed this thread... Basically I changed
Build Options>Linker Settings>Other Linker Options>Other linker options: wx-config –libs
To
Build Options>Linker Settings>Other Linker Options>Other linker options: wx-config –libs –gl-libs
I get this:
obj/Debug/subclasswxglcanvas.o||In function wxGLCanvasSubClass::Render()’:|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|77|undefined reference to glutWireTeapot'|
glutWireTeapot’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|81|undefined reference to
obj/Debug/subclasswxglcanvas.o||In function wxGLCanvasSubClass':|
glutInit’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|41|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|41|undefined reference to glutInit'|
||=== Build finished: 4 errors, 0 warnings ===|
Great.... The thread stops there. But supposed on the forum he posts further :(
Couldn't find it...
found some stuff here looks like I need to link to glut somehow...
http://www.nabble.com/Linker-Errors-For-OpenGL---GLUT-%27Hello-World%27-Program.-td19449213.html
Oh.... hear is a tutorial on code::blocks with some specific issues regarding glut...
This is worth looking at:http://www.sci.brooklyn.cuny.edu/~goetz/codeblocks/
Ok.... This is weird... The error seems to have moved a bit... Not sure what I did but now I'm getting this error:
-------------- Build: Debug in opengltests ---------------
Compiling: subclasswxglcanvas.cpp
Linking console executable: bin/Debug/opengltests
: 1: Syntax error: EOF in backquote substitution
Process terminated with status 2 (0 minutes, 4 seconds)
0 errors, 0 warnings
Go... Figure.. What is that all about..
Duh.... http://www.developpez.net/forums/d650304/c-cpp/cpp/debuter/syntax-error-eof-in-backquote-substitution/
Ok... This is getting closer
Ok.... I think I've come full circle now.
I made the following change:
Build Options>Linker Settings>Other Linker Options>Other linker options: wx-config –libs –gl-libs –lglut and I got this message:
obj/Debug/subclasswxglcanvas.o||In function __static_initialization_and_destruction_0′:|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|26|undefined reference towxEventHashTable::wxEventHashTable(wxEventTable const&)'|
wxEVT_PAINT’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|28|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|28|undefined reference towxEVT_NULL'|
__tcf_1′:|
obj/Debug/subclasswxglcanvas.o||In function
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|26|undefined reference towxEventHashTable::~wxEventHashTable()'|
main’:|
obj/Debug/subclasswxglcanvas.o||In function
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|95|undefined reference towxEntry(int&, char**)'|
wxCreateApp()’:|
obj/Debug/subclasswxglcanvas.o||In function
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|95|undefined reference towxAppConsole::CheckBuildOptions(char const*, char const*)'|
wxGLCanvasSubClass::Render()’:|
obj/Debug/subclasswxglcanvas.o||In function
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|51|undefined reference towxGLCanvas::SetCurrent()'|
wxPaintDC::wxPaintDC(wxWindow*)’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|52|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|53|undefined reference toglClearColor'|
glClear’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|54|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|55|undefined reference toglViewport'|
glBegin’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|57|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|58|undefined reference toglColor3f'|
glVertex2f’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|59|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|60|undefined reference toglVertex2f'|
glVertex2f’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|61|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|62|undefined reference toglVertex2f'|
glColor3f’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|63|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|64|undefined reference toglVertex2f'|
glEnd’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|65|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|67|undefined reference toglBegin'|
glColor3f’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|68|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|69|undefined reference toglVertex2f'|
glVertex2f’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|70|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|71|undefined reference toglVertex2f'|
glVertex2f’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|72|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|73|undefined reference toglEnd'|
glColor4f’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|76|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|77|undefined reference toglutWireTeapot'|
glLoadIdentity’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|79|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|80|undefined reference toglColor4f'|
glutWireTeapot’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|81|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|84|undefined reference toglFlush'|
wxGLCanvas::SwapBuffers()’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|85|undefined reference to
obj/Debug/subclasswxglcanvas.o||In functionwxGLCanvasSubClass':|
wxNullPalette’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|31|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|31|undefined reference towxDefaultSize'|
wxDefaultPosition’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|31|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|31|undefined reference towxGLCanvas::wxGLCanvas(wxWindow*, int, wxPoint const&, wxSize const&, long, wxString const&, int*, wxPalette const&)'|
wxConvLibc’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|33|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|41|undefined reference toglutInit'|
wxGLCanvas::~wxGLCanvas()’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|42|undefined reference to
obj/Debug/subclasswxglcanvas.o||In functionMyApp::OnInit()':|
wxFrameNameStr’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|100|undefined reference to
obj/Debug/subclasswxglcanvas.o||In functionwxGLCanvasSubClass':|
wxNullPalette’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|31|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|31|undefined reference towxDefaultSize'|
wxDefaultPosition’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|31|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|31|undefined reference towxGLCanvas::wxGLCanvas(wxWindow*, int, wxPoint const&, wxSize const&, long, wxString const&, int*, wxPalette const&)'|
wxConvLibc’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|33|undefined reference to
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|41|undefined reference toglutInit'|
wxGLCanvas::~wxGLCanvas()’|
/home/jonas/wx_opengl_experiments/opengltests/subclasswxglcanvas.cpp|42|undefined reference to
obj/Debug/subclasswxglcanvas.o||In functionwxStringBase::Init()':|
wxEmptyString’|
/usr/include/wx-2.8/wx/string.h|270|undefined reference to
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options…|
||=== Build finished: 50 errors, 0 warnings ===|
So…. This brings me back to this page.
http://ubuntuforums.org/showthread.php?p=5907768
I think I must be missing something very options here….
WxWiki says.
This compiled and worked with ‘g++ main.cpp -o glWx-Config --libs --cxxflags --gl-libs
‘ (note the extra flag for Wx-Config) plus your platform’s flags to link against OpenGL and GLUT.
Hmm.
Found a link on the ubuntu forum:
http://ubuntuforums.org/showthread.php?t=296421
which pointed me here
I wound up posting on wxforums…
Basically, I had my linker settings messed up..
So in summary:
For the sample code found at http://wiki.wxwidgets.org/WxGLCanvas,
On Ubuntu 8.04, using code::blocks the following settings will get the thing running.
project>Build Options>Compiler Settings>Other Options:wx-config --cxxflags
project>Build Options>Linker Settng>Other Linking Options>wx-config --libs --gl-libs
-lGL -lglut
Legend. I am just trying to get figure wx and gl to write a *basic* 3D cad program and ran straight into this problem running the wxGLCanvas example. I am really glad you took the time to document your solution.
Your welcome….
Thanks a lot!
Thanks a lot, this should be in the wiki!
For people with this problem, when using the advice at the end of this post, make sure you use double hyphens for the wx-config parameters – in my browser it shows up as
wx-config -cxxflags
when it should be
wx-config --cxxflags
I think this website has some autoformat settings that are to blame.
Big huh… It seems to be double hypens when I’m looking at it. Thanks for pointing that out.