[osg-users] [GL ES2] Compilation errors on master branch
Alex Cham
cau.mbox at gmail.com
Sun Jul 19 00:31:47 PDT 2015
Hi, Here is what i have found & how it was fixed
OpenSceneGraph Version
#define OPENSCENEGRAPH_MAJOR_VERSION 3
#define OPENSCENEGRAPH_MINOR_VERSION 5
#define OPENSCENEGRAPH_PATCH_VERSION 0
#define OPENSCENEGRAPH_SOVERSION 130
$ git log -1
commit bc3a77cb1561ed2e47e88ab507180bcf15309f31
Author: Robert OSFIELD <>
Date: Fri Jul 17 18:31:22 2015 +0000
Configure & Compile OSG For GLESX
http://trac.openscenegraph.org/projects/osg/wiki/Community/OpenGL-ES
$ ls -ail /usr/lib/x86_64-linux-gnu | grep EG
671904 lrwxrwxrwx 1 root root 15 Jul 10 13:08 libEGL.so -> libEGL.so.1.0.0
671897 lrwxrwxrwx 1 root root 15 Jul 10 13:08 libEGL.so.1 -> libEGL.so.1.0.0
656425 -rw-r--r-- 1 root root 173208 Jul 10 13:08 libEGL.so.1.0.0
$ ls -ail /usr/lib/x86_64-linux-gnu | grep ES
660380 lrwxrwxrwx 1 root root 21 Jul 10 13:08 libGLESv1_CM.so.1 -> libGLESv1_CM.so.1.1.0
660378 -rw-r--r-- 1 root root 18232 Jul 10 13:08 libGLESv1_CM.so.1.1.0
656932 lrwxrwxrwx 1 root root 18 Jul 10 13:08 libGLESv2.so -> libGLESv2.so.2.0.0
671907 lrwxrwxrwx 1 root root 18 Jul 10 13:08 libGLESv2.so.2 -> libGLESv2.so.2.0.0
668652 -rw-r--r-- 1 root root 26424 Jul 10 13:08 libGLESv2.so.2.0.0
$ ls -ail /usr/include/ | grep ES
1573223 drwxr-xr-x 2 root root 4096 Jul 18 20:16 GLES2
1573218 drwxr-xr-x 2 root root 4096 Jul 18 20:16 GLES3
mkdir ./GLES2ContextBuild
cd ./GLES2ContextBuild
cmake \
-DCMAKE_C_COMPILER="/usr/bin/clang" \
-DCMAKE_CXX_COMPILER="/usr/bin/clang++" \
-DCMAKE_CXX_FLAGS="-std=c++11 -v -Wall" \
-DBUILD_OSG_EXAMPLES=1 \
-DOSG_GL1_AVAILABLE=OFF \
-DOSG_GL2_AVAILABLE=OFF \
-DOSG_GL3_AVAILABLE=OFF \
-DOSG_GLES1_AVAILABLE=OFF \
-DOSG_GLES2_AVAILABLE=ON \
-DOPENGL_INCLUDE_DIR=/usr/include/ \
-DOPENGL_LIBRARY=/usr/lib/x86_64-linux-gnu/libGLESv2.so \
-DOPENGL_egl_LIBRARY=/usr/lib/x86_64-linux-gnu/libEGL.so \
-DOSG_GL_DISPLAYLISTS_AVAILABLE=OFF \
-DSG_GL_MATRICES_AVAILABLE=OFF \
-DOSG_GL_VERTEX_FUNCS_AVAILABLE=OFF \
-DOSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE=OFF \
-DOSG_GL_FIXED_FUNCTION_AVAILABLE=OFF \
-DOSG_CPP_EXCEPTIONS_AVAILABLE=OFF \
../GLES2ContextSource
LLVMToolchain Errors & Fixes
typedef redefinition with different types (typedef long long int
GLint64)
E:
/home/alex/dev/sources/osgbullet/Dependencies/osg/LLVM/GLES2ContextBuild/include/osg/GL:123:31: error: typedef redefinition with different types
('long long' vs 'khronos_int64_t' (aka 'long'))
typedef long long int GLint64;
^
/usr/include/GLES2/gl2.h:63:25: note: previous definition is here
typedef khronos_int64_t GLint64;
F:
osg/src/osg/GL.in
Just comment or remove the else block and all compiles perfect. GLint64 is
already defined in headers provided by Mesa3d for your platform as "typedef
khronos_int64_t GLint64;" For Windows maybe, have nothing to say here because i
dont use it, but for Linux why should we redefine something here explicitly?
#if !defined(GL_VERSION_3_1)
#ifdef _WIN32
typedef __int64 GLint64;
typedef unsigned __int64 GLuint64;
#else
/*typedef long long int GLint64;*/
/*typedef unsigned long long int GLuint64;*/
#endif
#endif
undeclared identifier 'GL_ALPHA_TEST'
E:
/home/alex/dev/sources/osgbullet/Dependencies/osg/LLVM/GLES2ContextSource/examples/osgSSBO/osgSSBO.cpp:550:48: error: use of undeclared identifier
'GL_ALPHA_TEST'
_computationResultsRenderStateSet->setMode(GL_ALPHA_TEST, osg::StateAttribute::ON);
F:
GL_ALPHA_TEST Is not declared in GLES2
https://www.khronos.org/opengles/sdk/docs/man/xhtml/glEnable.xml
http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk/examples/osgSSBO/CMakeLists.txt
IF ((OPENGL_PROFILE STREQUAL "GL3") OR (OPENGL_PROFILE STREQUAL "GLCORE"))
# E: 2
#/home/alex/dev/sources/osgbullet/Dependencies/osg/GL43HeadersConventionSource/examples/osgSSBO/osgSSBO.cpp:550:48: error: ‘GL_ALPHA_TEST’ was not declared in this scope
# _computationResultsRenderStateSet->setMode(GL_ALPHA_TEST, osg::StateAttribute::ON);
# F:
# GL 2
#GL_ALPHA_TEST
#
#If enabled,do alpha testing. See glAlphaFunc.
#
#https://www.opengl.org/sdk/docs/man2/xhtml/glEnable.xml
# GL 3
#No Enumerant GL_ALPHA_TEST
#https://www.opengl.org/sdk/docs/man3/xhtml/glEnable.xml
ELSEIF(OSG_GLES2_AVAILABLE STREQUAL "ON")
#E:
#/home/alex/dev/sources/osgbullet/Dependencies/osg/LLVM/GLES2ContextSource/examples/osgSSBO/osgSSBO.cpp:550:48: error: use of undeclared identifier
# 'GL_ALPHA_TEST'
# _computationResultsRenderStateSet->setMode(GL_ALPHA_TEST, osg::StateAttribute::ON);
#
#
#F:
#
#http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk/examples/osgSSBO/CMakeLists.txt
#
#GL_ALPHA_TEST Is not declared in GLES2
#
#https://www.khronos.org/opengles/sdk/docs/man/xhtml/glEnable.xml
ELSE()
SET(TARGET_SRC osgSSBO.cpp )
SETUP_EXAMPLE(osgSSBO)
ENDIF()
call to 'isinf' is ambiguous
E:
/home/alex/dev/sources/osgbullet/Dependencies/osg/LLVM/GLES2ContextSource/src/osgPlugins/osgjs/json_stream:98:20: error: call to 'isinf' is ambiguous
if(isinf(d)) {
F:
As i'm not needed in osgjs i just comment it out, but ofc error must be fixed
apropriately
http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk/src/osgPlugins/CMakeLists.txt
# ADD_SUBDIRECTORY(osgjs)
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=64360#64360
More information about the osg-users
mailing list