missing GLEW

Hi

After switching to the developement version, I had these linker errors

ofAppRunner.cpp:(.text+0x431): undefined reference to glewExperimental' ofAppRunner.cpp:(.text+0x437): undefined reference toglewInit’
ofAppRunner.cpp:(.text+0x442): undefined reference to `glewGetErrorString’

I thought maybe the link to glew wasn’t in the makefile for some reason, so I added it manually with -lGLEW. but still no success. I have libglew1.6-dev installed and run ubuntu 11.10.

Did anybody else ever have this problem? thanks

hmm looks like it is not just GLEW, but GLU as well?

  
ofGLRenderer.cpp:(.text+0x5bb): undefined reference to `gluProject'  
../../../libs/openFrameworksCompiled/lib/linux64/libopenFrameworks.a(ofGLRenderer.o): In function `ofGLRenderer::setupScreenPerspective(float, float, ofOrientation, bool, float, float, float)':  
ofGLRenderer.cpp:(.text+0x132e): undefined reference to `gluPerspective'  
ofGLRenderer.cpp:(.text+0x1378): undefined reference to `gluLookAt'  
  

ok, I found the problem. Looks like I somehow installed GLEW 1.6 but OF needs 1.5 to run. Maybe we should adress this issue, since the official glew version is already at 1.7?

mmh, i’ve had this problem but is not actually related with glew but with pkg-config failing because jack is not there. some update lately uninstalled libjack-dev because it was updated to version 2. rerunning install_dependecies or installing libjack-jackd2-dev solved it

I also had that problem, if you encounter it please make sure that you have both libjack-dev and GLEW 1.5 Version.

I have the same problem with OF 0071, starting from bulding the projectGenerator (which failed due to GLEW / GLU linking):

…/…/…/libs/openFrameworksCompiled/lib/linux/libopenFrameworks.a(ofAppRunner.o): In function ofSetupOpenGL(ofPtr<ofAppBaseWindow>, int, int, int)': ofAppRunner.cpp:(.text+0x5df): undefined reference toglewExperimental’
ofAppRunner.cpp:(.text+0x5e5): undefined reference to glewInit' ofAppRunner.cpp:(.text+0x5f8): undefined reference toglewGetErrorString’
…/…/…/libs/openFrameworksCompiled/lib/linux/libopenFrameworks.a(ofGLRenderer.o): In function ofGLRenderer::setBlendMode(ofBlendMode)': ofGLRenderer.cpp:(.text+0x2ec): undefined reference to__glewBlendEquation’
ofGLRenderer.cpp:(.text+0x32b): undefined reference to \_\_glewBlendEquation' ofGLRenderer.cpp:(.text+0x358): undefined reference to__glewBlendEquation’

I am compiling on a linux machine running Ubuntu 10.04

BTW, I did run the OFX/scripts/linux/ubuntu/install_dependenies.sh

SOLUTION : In my case I had to add -lGLEW to the compilation line in order to get the projectGenerator to compile and link fine… However, since other examples (including my apps) were suffering from the same GLEW linking problem I ended up adding -lGLEW directly to the OFX/libs/openFrameworksCompiled/project/makefileCommon/Makefile.linux (since Linux is my platform). After this my app compiled and linked properly.

I’m not sure if the GLEW library linkage was purposefully or accidentally omitted from the OFX. I know there is a glew folder/source included with OFX, so perhaps the OFX-glew versionw as supposed to be used instead. At any rate, the OFX apps do not find the GLEW functions in any of the libraries included during linking.

Same here. I’ve tried different releases of OF: development, master and 0071 but to no avail. :frowning:

Usually I know my way around this but I’m really lost in this one.

(Trying to get OF running on an Ubuntu lucid 10.04 install)

Rg,

Arnaud

I’ve just tried 007 and that works. The release 0071 doesn’t:

  
$ make Debug  
Package zlib was not found in the pkg-config search path.  
Perhaps you should add the directory containing `zlib.pc'  
to the PKG_CONFIG_PATH environment variable  
No package 'zlib' found  
linking x86_64 bin/projectGenerator_debug linux64  
mkdir -p bin  
g++ -o bin/projectGenerator_debug obj/x86_64Debug/src/addons/ofAddon.o obj/x86_64Debug/src/testApp.o obj/x86_64Debug/src/projects/baseProject.o obj/x86_64Debug/src/projects/visualStudioProject.o obj/x86_64Debug/src/projects/xcodeProject.o obj/x86_64Debug/src/projects/CBLinuxProject.o obj/x86_64Debug/src/projects/CBWinProject.o obj/x86_64Debug/src/main.o obj/x86_64Debug/src/pugixmlLib/src/pugixml.o obj/x86_64Debug/src/utils/ofAppNoWindow.o obj/x86_64Debug/src/utils/Utils.o obj/x86_64Debug/addons/ofxXmlSettings/src/ofxXmlSettings.o obj/x86_64Debug/addons/ofxXmlSettings/libs/tinyxmlparser.o obj/x86_64Debug/addons/ofxXmlSettings/libs/tinyxmlerror.o obj/x86_64Debug/addons/ofxXmlSettings/libs/tinyxml.o  -Wl,-rpath=./libs  ../..//libs/openFrameworksCompiled/lib/linux64/libopenFrameworksDebug.a    ../..//libs/poco/lib/linux64/libPocoNet.a ../..//libs/poco/lib/linux64/libPocoXML.a ../..//libs/poco/lib/linux64/libPocoUtil.a ../..//libs/poco/lib/linux64/libPocoFoundation.a ../..//libs/freetype/lib/linux64/libfreetype.a ../..//libs/kiss/lib/linux64/libkiss.a ../..//libs/portaudio/lib/linux64/libportaudio.a ../..//libs/rtAudio/lib/linux64/libRtAudio.a ../..//libs/tess2/lib/linux64/libtess2.a -L../..//libs/fmodex/lib/linux64 -L../..//libs/freetype/lib/linux64 -L../..//libs/kiss/lib/linux64 -L../..//libs/openFrameworksCompiled/lib/linux64 -L../..//libs/poco/lib/linux64 -L../..//libs/portaudio/lib/linux64 -L../..//libs/rtAudio/lib/linux64 -L../..//libs/tess2/lib/linux64 -lfmodex -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0   -lmpg123  -lglut -lGL -lasound -lopenal -lsndfile -lvorbis -lFLAC -logg -lfreeimage  
../..//libs/openFrameworksCompiled/lib/linux64/libopenFrameworksDebug.a(ofAppRunner.o): In function `ofSetupOpenGL(ofPtr<ofAppBaseWindow>, int, int, int)':  
/home/z25/Documents/z25/test/test/0071/libs/openFrameworksCompiled/project/linux64/../../../openFrameworks/app/ofAppRunner.cpp:87: undefined reference to `glewExperimental'  
/home/z25/Documents/z25/test/test/0071/libs/openFrameworksCompiled/project/linux64/../../../openFrameworks/app/ofAppRunner.cpp:88: undefined reference to `glewInit'  
/home/z25/Documents/z25/test/test/0071/libs/openFrameworksCompiled/project/linux64/../../../openFrameworks/app/ofAppRunner.cpp:92: undefined reference to `glewGetErrorString'  
../..//libs/openFrameworksCompiled/lib/linux64/libopenFrameworksDebug.a(ofTexture.o): In function `ofTexture::loadData(void*, int, int, int)':  
/home/z25/Documents/z25/test/test/0071/libs/openFrameworksCompiled/project/linux64/../../../openFrameworks/gl/ofTexture.cpp:690: undefined reference to `gluBuild2DMipmaps'  
/home/z25/Documents/z25/test/test/0071/libs/openFrameworksCompiled/project/linux64/../../../openFrameworks/gl/ofTexture.cpp:693: undefined reference to `gluBuild2DMipmaps'  
/home/z25/Documents/z25/test/test/0071/libs/openFrameworksCompiled/project/linux64/../../../openFrameworks/gl/ofTexture.cpp:696: undefined reference to `gluBuild2DMipmaps'  
/home/z25/Documents/z25/test/test/0071/libs/openFrameworksCompiled/project/linux64/../../../openFrameworks/gl/ofTexture.cpp:699: undefined reference to `gluBuild2DMipmaps  
/home/z25/Documents/z25/test/test/0071/libs/openFrameworksCompiled/project/linux64/../../../openFrameworks/gl/ofTexture.cpp:706: undefined reference to `gluBuild2DMipmaps'  
../..//libs/openFrameworksCompiled/lib/linux64/libopenFrameworksDebug.a(ofTexture.o):/home/z25/Documents/z25/test/test/0071/libs/openFrameworksCompiled/project/linux64/../../../openFrameworks/gl/ofTexture.cpp:709: more undefined references to `gluBuild2DMipmaps' follow  
../..//libs/openFrameworksCompiled/lib/linux64/libopenFrameworksDebug.a(ofTexture.o): In function `ofTexture::drawSubsection(float, float, float, float, float, float, float, float, float)':  
/home/z25/Documents/z25/test/test/0071/libs/openFrameworksCompiled/project/linux64/../../../openFrameworks/gl/ofTexture.cpp:950: undefined reference to `__glewActiveTexture'  
../..//libs/openFrameworksCompiled/lib/linux64/libopenFrameworksDebug.a(ofTexture.o): In function `ofTexture::draw(ofVec3f const&, ofVec3f const&, ofVec3f const&, ofVec3f const&)':  
/home/z25/Documents/z25/test/test/0071/libs/openFrameworksCompiled/project/linux64/../../../openFrameworks/gl/ofTexture.cpp:1065: undefined reference to `__glewActiveTexture'  
../..//libs/openFrameworksCompiled/lib/linux64/libopenFrameworksDebug.a(ofGLRenderer.o): In function `ofGLRenderer::setupScreenPerspective(float, float, ofOrientation, bool, float, float, float)':  
/home/z25/Documents/z25/test/test/0071/libs/openFrameworksCompiled/project/linux64/../../../openFrameworks/gl/ofGLRenderer.cpp:363: undefined reference to `gluPerspective'  
/home/z25/Documents/z25/test/test/0071/libs/openFrameworksCompiled/project/linux64/../../../openFrameworks/gl/ofGLRenderer.cpp:367: undefined reference to `gluLookAt'  
../..//libs/openFrameworksCompiled/lib/linux64/libopenFrameworksDebug.a(ofGLRenderer.o): In function `ofGLRenderer::setBlendMode(ofBlendMode)':  
/home/z25/Documents/z25/test/test/0071/libs/openFrameworksCompiled/project/linux64/../../../openFrameworks/gl/ofGLRenderer.cpp:830: undefined reference to `__glewBlendEquation'  
/home/z25/Documents/z25/test/test/0071/libs/openFrameworksCompiled/project/linux64/../../../openFrameworks/gl/ofGLRenderer.cpp:839: undefined reference to `__glewBlendEquation'  
/home/z25/Documents/z25/test/test/0071/libs/openFrameworksCompiled/project/linux64/../../../openFrameworks/gl/ofGLRenderer.cpp:848: undefined reference to `__glewBlendEquation'  
/home/z25/Documents/z25/test/test/0071/libs/openFrameworksCompiled/project/linux64/../../../openFrameworks/gl/ofGLRenderer.cpp:857: undefined reference to `__glewBlendEquation'  
/home/z25/Documents/z25/test/test/0071/libs/openFrameworksCompiled/project/linux64/../../../openFrameworks/gl/ofGLRenderer.cpp:866: undefined reference to `__glewBlendEquation'  
../..//libs/openFrameworksCompiled/lib/linux64/libopenFrameworksDebug.a(ofGLRenderer.o): In function `ofGLRenderer::drawString(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, float, float, float, ofDrawBitmapMode)':  
/home/z25/Documents/z25/test/test/0071/libs/openFrameworksCompiled/project/linux64/../../../openFrameworks/gl/ofGLRenderer.cpp:1129: undefined reference to `gluProject'  
collect2: ld returned 1 exit status  
make: *** [bin/projectGenerator_debug] Error 1  

Also a note that on the 0071 version I downloaded from the site the config.make OF_ROOT path is invalid in the projectGenerator…

Rg,

Arnaud

It does seem to be an issue with the Makefile. I’ve set:

  
USER_LDFLAGS = -lGLEW  

in the projects config.make. That gets rid off the glew linking errors but leaves me with Gstreamer errors:

  
openFrameworks/video/ofGstUtils.cpp:657: undefined reference to `gst_app_sink_pull_buffer'  

But I’ve copied a Makefile from a 007 release and then it compiles just fine! Even without the USER_LDFLAGS = -lGLEW.

So a fix for me now is to use Makefiles from 007 on an Ubuntu Lucid machine. If I find time I’ll try to find out why.

Rg,

Arnaud

can you diff the two makefiles to find out what is different?
what’s your gcc version, btw? lucid is pretty old, and we had some troubles recently with old gcc versions.

the problem seems to be in this line:

No package ‘zlib’ found

try installing zlib1g-dev or just remove any references to zlib in Makefile.example

It’s hard to do a diff since the structure of the Makefile differs a lot. Post 007 makefiles include other makefiles. I’ve tried to do a diff but it just gives back every line is different. It probably takes a human to find the differences.

I’m using the default lucid packages so gcc 4.4.3-4ubuntu5

If I would search for differences now I’d be looking at lib linking order.

Rg,

Arnaud

I’d seen that error but zlib1g-dev is already installed. It might be missing a pkg-config entry?
I’ve tried removing the entry in libs/openFrameworksCompiled/project/makefileCommon/Makefile.linux and that does work. It compiles fine now… :slight_smile:

Rg,

Arnaud

i guess they added the pkg-config entry for zlib later, i think that was added from someone using latest debian and probably broke older versions

zlib only recently has been added by benben, in https://github.com/openframeworks/openFrameworks/commit/7bb237c6271b3c7b2684c4f34d000bd92a1aa387
I wonder why it breaks older versions, though?

It seems to be a bug in the zlib lucid package:

https://bugs.launchpad.net/ubuntu/+source/zlib/+bug/638252

Ah, nice. good to know it’s not an OF problem. :slight_smile: