#345 Stage3-git: missing GLU libraries on linking

stage (111)
Jan Schlüter

In my setup (Ubuntu 10.04) the linker commands in the make files generated by cmake for the git version of Stage do not include -lglu, causing errors when linking libstage.so (of the kind: "undefined reference to 'gluSphere'").
To fix, I had to uncomment the line "# ${OPENGL_LIBRARIES} # is it safe to remove permanently?" in libstage/CMakeLists.txt.

The problem seems to be that most versions of fltk-config automatically include -lglu, but the ones of Debian/Ubuntu do not - the same problem was described here for Ubuntu 7.10 three years ago: http://www.geuz.org/pipermail/gmsh/2007/002835.html

My setup:
$ dpkg -l | fltk
ii libfltk1.1 1.1.10-2 Fast Light Toolkit - shared libraries
ii libfltk1.1-dev 1.1.10-2 Fast Light Toolkit - development files
$ fltk-config --version
$ fltk-config --use-gl --use-graphics --ldflags
-Wl,-Bsymbolic-functions -lfltk_images -lfltk_gl -lfltk

Please tell me if you need any further information about my system configuration.


  • Rich Mattes
    Rich Mattes

    It looks like Ubuntu patched the GL libraries out of fltk-config. It's probably not safe to uncomment the GL libraries in all cases, as other distributions will have the GL libraries in fltk-config. Try to apply the attached patch, it should add the GL libs to the target if "-lGL" isn't in the FLTK_LDFLAGS.

  • Rich Mattes
    Rich Mattes

    Add missing opengl libraries

  • Fixed in SVN HEAD. Thanks very much for the report.

  • Uncommented the extra link flag as described. Thanks for the report.

    • status: open --> closed-fixed
  • My previous comment was too hasty. I read Rich Mattes' comment below and went with his approach, now committed to master.