GLCanvas

Post here wxCrafter related issues / features / bugs
LairdTurner
CodeLite Enthusiast
Posts: 15
Joined: Tue Mar 06, 2012 12:11 pm
Genuine User: Yes
IDE Question: C++
Contact:

GLCanvas

Post by LairdTurner »

Hi!

I want to start building a little Programm with an opengl canvas. I've created a standard GUI Project for wxcrafter and pulled the gl canvas in a sizer.
When I start the build I get this error message.

/bin/sh -c 'make -j8 -e -f Makefile'
----------Building project:[ test1 - Debug ]----------
/usr/bin/clang++ -o ./Debug/test1 @"test1.txt" -L. -L/Users/rhoeger/Documents/src/wxWidgets/tags/WX_3_0_1/build-debug/lib -framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework System -framework OpenGL -lwx_osx_cocoau-3.0
Undefined symbols for architecture x86_64:
"wxGLCanvas::wxGLCanvas(wxWindow*, int, int const*, wxPoint const&, wxSize const&, long, wxString const&, wxPalette const&)", referenced from:
MainFrameBaseClass::MainFrameBaseClass(wxWindow*, int, wxString const&, wxPoint const&, wxSize const&, long) in wxcrafter.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [Debug/test1] Error 1
make: *** [All] Error 2
1 errors, 0 warnings

How can I solve this issue?


-René
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: GLCanvas

Post by eranif »

Hi,

Is your wxWidgets compiled with OpenGL support?

Eran
Make sure you have read the HOW TO POST thread
LairdTurner
CodeLite Enthusiast
Posts: 15
Joined: Tue Mar 06, 2012 12:11 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: GLCanvas

Post by LairdTurner »

Hi!

I was not shure so I've compiles wxwidgets with the flag --with-opengl but in the subsumption of the configuration it states 'open gl support: no'.
Btw. with the option on I get the same error.
The wxwidgets opengl sample works!




-René
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: GLCanvas

Post by eranif »

Try to compare the link lines between codelite's workspace and the link line produced by the sample ( you can also paste them both here and I might help you with this)
Make sure you have read the HOW TO POST thread
LairdTurner
CodeLite Enthusiast
Posts: 15
Joined: Tue Mar 06, 2012 12:11 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: GLCanvas

Post by LairdTurner »

Hi!

Sorry for the late delay! I was busy at work.
Here are the lines if I call the make function of the make demo isosurface from wxWidgets

###################################################################
kcwp801:isosurf rhoeger$ make
/Users/rhoeger/Documents/src/wxWidgets/tags/WX_3_0_1/build-debug/bk-deps clang++ -std=c++11 -stdlib=libc++ -mmacosx-version-min=10.8 -c -o isosurf_isosurf.o -D__WXOSX_COCOA__ -I../../../../samples/opengl/isosurf -DWXUSINGDLL -I../../../../samples/opengl/isosurf/../../../samples -Wall -Wundef -Wunused-parameter -Wno-ctor-dtor-privacy -Woverloaded-virtual -Wno-deprecated-declarations -D_FILE_OFFSET_BITS=64 -I/Users/rhoeger/Documents/src/wxWidgets/tags/WX_3_0_1/build-debug/lib/wx/include/osx_cocoa-unicode-3.0 -I../../../../include -DWX_PRECOMP -g -O0 -fno-common ../../../../samples/opengl/isosurf/isosurf.cpp
clang++ -std=c++11 -stdlib=libc++ -mmacosx-version-min=10.8 -o isosurf isosurf_isosurf.o -L/Users/rhoeger/Documents/src/wxWidgets/tags/WX_3_0_1/build-debug/lib -framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework System -framework OpenGL -lwx_osx_cocoau_gl-3.0 -framework OpenGL -framework AGL -lwx_osx_cocoau_core-3.0 -lwx_baseu-3.0 -lwxtiff-3.0 -lwxjpeg-3.0 -lwxpng-3.0 -framework WebKit -lwxregexu-3.0 -framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework System -framework OpenGL -lz -lpthread -liconv -llzma -lz -lpthread -liconv -llzma
SetFile -t APPL isosurf
mkdir -p isosurf.app/Contents
mkdir -p isosurf.app/Contents/MacOS
mkdir -p isosurf.app/Contents/Resources
sed -e "s/IDENTIFIER/`echo ../../../../samples/opengl/isosurf | sed -e 's,\.\./,,g' | sed -e 's,/,.,g'`/" \
-e "s/EXECUTABLE/isosurf/" \
-e "s/VERSION/3.0.1/" \
../../../../src/osx/carbon/Info.plist.in >isosurf.app/Contents/Info.plist
/bin/echo "APPL????" >isosurf.app/Contents/PkgInfo
ln -f isosurf isosurf.app/Contents/MacOS/isosurf
cp -f ../../../../src/osx/carbon/wxmac.icns isosurf.app/Contents/Resources/wxmac.icns
###################################################################

And these are the lines from the codelite output window

###################################################################
/bin/sh -c 'make -j8 -e -f Makefile'
----------Building project:[ test1 - Debug ]----------
/usr/bin/clang++ -o ./Debug/test1 @"test1.txt" -L. -L/Users/rhoeger/Documents/src/wxWidgets/tags/WX_3_0_1/build-debug/lib -framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework System -framework OpenGL -lwx_osx_cocoau_xrc-3.0 -lwx_osx_cocoau_webview-3.0 -lwx_osx_cocoau_html-3.0 -lwx_osx_cocoau_qa-3.0 -lwx_osx_cocoau_adv-3.0 -lwx_osx_cocoau_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0
Undefined symbols for architecture x86_64:
"wxGLCanvas::wxGLCanvas(wxWindow*, int, int const*, wxPoint const&, wxSize const&, long, wxString const&, wxPalette const&)", referenced from:
MainFrameBaseClass::MainFrameBaseClass(wxWindow*, int, wxString const&, wxPoint const&, wxSize const&, long) in wxcrafter.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [Debug/test1] Error 1
make: *** [All] Error 2
1 errors, 0 warnings

###################################################################

The demos all working. So OpenGL should'nt be the problem.
Hope you can help me.

Thanks!


Sincerely

-René Höger
User avatar
eranif
CodeLite Plugin
Posts: 6367
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: GLCanvas

Post by eranif »

I can see several differences between the makefile and the one produced by codelite, for example:

Code: Select all

-std=c++11 -stdlib=libc++
and this one:

Code: Select all

-lwx_osx_cocoau_gl-3.0
Try adding them to the linker options (mainly the last one): right click the project->settings->common settings->linker
Search for the line that looks something like this:

Code: Select all

$(shell wx-config --libs)
and change it to:

Code: Select all

$(shell wx-config --libs std,gl)
Eran
Make sure you have read the HOW TO POST thread
LairdTurner
CodeLite Enthusiast
Posts: 15
Joined: Tue Mar 06, 2012 12:11 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: GLCanvas

Post by LairdTurner »

Hi!

I just want to let you know that the tip you gave me, worked! I'm currently very busy. Hope I have in the next weeks more time
to get some steps further. Thanks!


Sincerely

-René
Post Reply