Thursday, October 21, 2010

Re: Compiling OSG 2.8.0 in Cygwin- missing -lGL and -lGLU during linker stage

$ cmake ..
/usr/bin/cmake.exe: error while loading shared libraries: cygidn-11.dll: cannot open shared object file: No such file or directory

install libidn devel etc.?

$ cmake .. -DCMAKE_INSTALL_PREFIX=/home/newton/other/install
-- Could NOT find LibXml2  (missing:  LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR)
-- Could NOT find CURL  (missing:  CURL_LIBRARY CURL_INCLUDE_DIR)
-- Could NOT find OpenAL  (missing:  OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
-- Could NOT find PNG  (missing:  PNG_LIBRARY PNG_PNG_INCLUDE_DIR)

now get

XX shared library ../../bin/cygosg-66.dll
CMakeFiles/osg.dir/AlphaFunc.o:AlphaFunc.cpp:(.text+0x21a): undefined reference to `_glAlphaFunc'
CMakeFiles/osg.dir/ArrayDispatchers.o:ArrayDispatchers.cpp:(.text+0x1434): undefined reference to `_glVertex2fv'
CMakeFiles/osg.dir/ArrayDispatchers.o:ArrayDispatchers.cpp:(.text+0x145a): undefined reference to `_glVertex3fv'
CMakeFiles/osg.dir/ArrayDispatchers.o:ArrayDispatchers.cpp:(.text+0x1480): undefined reference to `_glVertex2dv'
CMakeFiles/osg.dir/ArrayDispatchers.o:ArrayDispatchers.cpp:(.text+0x14a6): undefined reference to `_glVertex3dv'
CMakeFiles/osg.dir/ArrayDispatchers.o:ArrayDispatchers.cpp:(.text+0x14cc): undefined reference to `_glNormal3bv'

Edit

From your build tree type "make edit_cache", this is the same as running "ccmake /path/to/source/tree".

http://forum.openscenegraph.org/viewtopic.php?t=2071

Check the contents of the OPENGL_gl_LIBRARY and OPENGL_glu_LIBRARY variables.  They should be pointed to the libraries you want to use for GL and GLU.  They are under the Advanced section of the cache.


On Fri, Mar 27, 2009 at 3:55 PM, Lucas wrote:
Otherwise there will be a lot of error output like this:

[ 15%] Building CXX object src/osg/CMakeFiles/osg.dir/Viewport.o
Linking CXX shared library ../../bin/cygosg-2.8.0.dll
CMakeFiles/osg.dir/AlphaFunc.o:AlphaFunc.cpp:(.text+0x14): undefined
reference to `_glAlphaFunc'
CMakeFiles/osg.dir/BlendColor.o:BlendColor.cpp:(.text+0x159):
undefined reference to `_glGetString'
CMakeFiles/osg.dir/BlendColor.o:BlendColor.cpp:(.text+0x288):
undefined reference to `_glGetString'
CMakeFiles/osg.dir/BlendColor.o:BlendColor.cpp:(.text+0x3c8):
undefined reference to `_glGetString'
CMakeFiles/osg.dir/BlendColor.o:BlendColor.cpp:(.text+0x1263):
undefined reference to `_glGetString'
CMakeFiles/osg.dir/BlendEquation.o:BlendEquation.cpp:(.text+0x1b9):
undefined reference to `_glGetString'