[osg-users] [build] Can't execute Qt example in IOS environment

Christophe Lhe lhechris at gmail.com
Wed Feb 3 03:00:23 PST 2016


Hi,

My platform is Emac 10.9 with IOS sdk 8.2.

I succedeed in compiling OSG 3.4 for IOS.

I inserted the viewerQT example in QT creator, and added osgplugin.h found in osgviewerIphone example (needed for static lib).

But I have following error when I launch the viewerQT with the data file robot.osg :


Code:
Warning: detected OpenGL error 'invalid enumerant' at Before Renderer::compile
VERTEX glCompileShader "" FAILED
VERTEX Shader "" infolog:
ERROR: 0:16: Use of undeclared identifier 'gl_LightSource'
ERROR: 0:17: Use of undeclared identifier 'lpos'
ERROR: 0:18: Use of undeclared identifier 'lpos'
ERROR: 0:20: Use of undeclared identifier 'lpos'

FRAGMENT glCompileShader "" FAILED
FRAGMENT Shader "" infolog:
ERROR: 0:1: 'vec3' : declaration must include a precision qualifier for type
ERROR: 0:2: 'vec3' : declaration must include a precision qualifier for type
ERROR: 0:3: 'vec3' : declaration must include a precision qualifier for type
ERROR: 0:7: 'vec4' : declaration must include a precision qualifier for type
ERROR: 0:8: Use of undeclared identifier 'normalDir'
ERROR: 0:9: Use of undeclared identifier 'lightDir'
ERROR: 0:10: Use of undeclared identifier 'viewDir'
ERROR: 0:11: Use of undeclared identifier 'gl_FrontLightModelProduct'
ERROR: 0:12: Use of undeclared identifier 'color'
ERROR: 0:12: Use of undeclared identifier 'gl_FrontLightProduct'
ERROR: 0:13: Use of undeclared identifier 'ld'
ERROR: 0:13: Use of undeclared identifier 'nd'
ERROR: 0:14: Use of undeclared identifier 'color'
ERROR: 0:14: Use of undeclared identifier 'gl_FrontLightProduct'
ERROR: 0:14: Use of undeclared identifier 'diff'
ERROR: 0:15: Use of undeclared identifier 'color'
ERROR: 0:15: Use of undeclared identifier 'base'
ERROR: 0:16: Use of undeclared identifier 'diff'
ERROR: 0:18: Use of undeclared identifier 'ld'
ERROR: 0:18: Use of undeclared identifier 'vd'
ERROR: 0:19: Use of undeclared identifier 'color'
ERROR: 0:19: Use of undeclared identifier 'base'
ERROR: 0:19: Use of undeclared identifier 'gl_FrontLightProduct'
ERROR: 0:20: Use of undeclared identifier 'halfDir'
ERROR: 0:20: Use of undeclared identifier 'nd'
ERROR: 0:20: Use of undeclared identifier 'gl_FrontMaterial'
ERROR: 0:22: Use of undeclared identifier 'color'

glLinkProgram "" FAILED
Program "" infolog:
ERROR: One or more attached shaders not successfully compiled

Warning: Material::apply(State&) - not supported.
Warning: ShadeModel::apply(State&) - not supported.




Any help would be appreciated to have OSG working with QT on IOS...



Here is the cmake configuration : 
        -DOSG_BUILD_PLATFORM_IPHONE:BOOL=ON 
        -DDYNAMIC_OPENSCENEGRAPH:BOOL=OFF 
        -DDYNAMIC_OPENTHREADS:BOOL=OFF 
        -DIPHONE_SDKVER:STRING=8.2 
        -DBUILD_OSG_APPLICATIONS:BOOL=OFF 
        -DBUILD_OSG_EXAMPLES:BOOL=OFF 
        -DOPENGL_PROFILE:STRING=GLES2 
        -DOSG_USE_QT:BOOL=ON 
        -DQt5Core_DIR:STRING=/Users/qt/Qt5.5.1/5.5/ios/lib/cmake/Qt5Core 
        -DQt5Gui_DIR:STRING=/Users/qt/Qt5.5.1/5.5/ios/lib/cmake/Qt5Gui \
        -DQt5OpenGL_DIR:STRING=/Users/qt/Qt5.5.1/5.5/ios/lib/cmake/Qt5OpenGL \
        -DQt5WebKitWidgets_DIR:STRING=/Users/qt/Qt5.5.1/5.5/ios/lib/cmake/Qt5WebKitWidgets \
        -DQt5Widgets_DIR:STRING=/Users/qt/Qt5.5.1/5.5/ios/lib/cmake/Qt5Widgets

And I added following lines in CMakeLists.txt :
        set (CMAKE_FIND_ROOT_PATH ${IPHONE_DEVROOT} ${IPHONE_SDKROOT} ${CMAKE_PREFIX_PATH} CACHE string  "iOS find search path root")
        set (CMAKE_FIND_FRAMEWORK FIRST)
        set (CMAKE_SYSTEM_FRAMEWORK_PATH
              ${IPHONE_SDKROOT}/System/Library/Frameworks
              ${IPHONE_SDKROOT}/System/Library/PrivateFrameworks
              ${IPHONE_SDKROOT}/Developer/Library/Frameworks
        )
        set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
        set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
        set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
... 


Thank you!

Cheers,
christophe[/code]

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=66182#66182








More information about the osg-users mailing list