[wx-dev] wxGLCanvas
Stefan.Neis at t-online.de
Stefan.Neis at t-online.de
Wed Nov 1 07:05:50 PST 2006
Hi,
(snipp)
> In kdevelop I added this to "linker flags (LDFLAGS)" in the project options:
> "$(../Linux/wxWidgets/build-debug/wx-config --static --libs gl,core,base)"
(snipp)
Keep in mind that the linker is sensitive to the ordering of arguments you pass
to it, i.e. make sure that this stuff is appended at the _end_ of the linker
options.
(nipp)
> The program compiles just fine, but I get a linker error I just don't
> understand:
(snipp)
> /home/pwm/Projects/Axiom/Linux/wxWidgets/build-debug/lib/libwx_gtk2d_gl-27.a
> /home/pwm/Projects/Axiom/Linux/wxWidgets/build-debug/lib/libwx_gtk2d_core-2.7.a
> /home/pwm/Projects/Axiom/Linux/wxWidgets/build-debug/lib/libwx_based-2.7.a
> -L/usr/lib /usr/lib/libGLU.so /usr/lib/opengl/nvidia/lib/libGL.so
(snipp)
> -ldl ../../SigmaWindow/libSigmaWindow.a
(snipp)
See? You now have libwx_gtk2d_gl-2.7.a _before_ the libSigmaWindow.a, so
any references from libSigmaWindow.a to libwx_gtk2d... will remain unresolved,
i.e. you get exactly this kind of error:
(snipp)
> .../../SigmaWindow/libSigmaWindow.a(SwPanelView.o): In function
> `CSwPanelView::CreateControls()':
> /home/pwm/Projects/Axiom/SigmaWindow/SwPanelView.cpp:53: undefined
> reference to `wxGLCanvas::wxGLCanvas(wxWindow*, wxGLCanvas const*, int,
> wxPoint const&, wxSize const&, long, wxString const&, int*, wxPalette
> const&)'
> collect2: ld returned 1 exit status
(snipp)
> so what am I doing wrong?
Make sure that the output of wx-config "... --libs ..." is at the end of the linker command
and everything should be fine.
HTH,
Stefan
P.S.: wx-users would have been more appropriate.
More information about the wx-dev
mailing list