AnsweredAssumed Answered

fsl-gpu-sdk-2.2 broken when compiled with ubuntu 14.04 and GCC 4.8.4 with debug configuration

Question asked by Dehuan Xin on Dec 7, 2015

g++ -o T3DStressTest_d -g -pthread obj/Ubuntu/Debug/source/Config.o obj/Ubuntu/Debug/source/FurTexture.o obj/Ubuntu/Debug/source/MeshRender.o obj/Ubuntu/Debug/source/MeshRenderBasic.o obj/Ubuntu/Debug/source/MeshRenderNormals.o obj/Ubuntu/Debug/source/MeshRenderVB.o obj/Ubuntu/Debug/source/OptionParser.o obj/Ubuntu/Debug/source/Shader/FurShaderBase.o obj/Ubuntu/Debug/source/Shader/FurShaderMultiPass.o obj/Ubuntu/Debug/source/Shader/ShaderBase.o obj/Ubuntu/Debug/source/Shader/WhiteShader.o obj/Ubuntu/Debug/source/T3DStressTest.o obj/Ubuntu/Debug/source/T3DStressTest_Register.o  /home/user/fsl-gpu-sdk-2.2/DemoFramework/FslDemoAppGLES3/obj/Ubuntu/Debug/libFslDemoAppGLES3_d.a /home/user/fsl-gpu-sdk-2.2/DemoFramework/FslGraphics_Draft/obj/Ubuntu/Debug/libFslGraphics_Draft_d.a /home/user/fsl-gpu-sdk-2.2/DemoFramework/FslDemoHostEGL/obj/Ubuntu/Debug/libFslDemoHostEGL_d.a /home/user/fsl-gpu-sdk-2.2/DemoFramework/FslNativeGraphicsGLES3/obj/Ubuntu/Debug/libFslNativeGraphicsGLES3_d.a /home/user/fsl-gpu-sdk-2.2/DemoFramework/FslDemoPlatform/obj/Ubuntu/Debug/libFslDemoPlatform_d.a /home/user/fsl-gpu-sdk-2.2/DemoFramework/FslGraphicsEGL/obj/Ubuntu/Debug/libFslGraphicsEGL_d.a /home/user/fsl-gpu-sdk-2.2/DemoFramework/FslGraphicsGLES3/obj/Ubuntu/Debug/libFslGraphicsGLES3_d.a /home/user/fsl-gpu-sdk-2.2/DemoFramework/FslDemoHost/obj/Ubuntu/Debug/libFslDemoHost_d.a /home/user/fsl-gpu-sdk-2.2/DemoFramework/FslDemoApp/obj/Ubuntu/Debug/libFslDemoApp_d.a /home/user/fsl-gpu-sdk-2.2/DemoFramework/FslGraphics/obj/Ubuntu/Debug/libFslGraphics_d.a /home/user/fsl-gpu-sdk-2.2/DemoFramework/FslBase/obj/Ubuntu/Debug/libFslBase_d.a -lIL -lEGL -lX11 -lXrandr -lGLESv2

obj/Ubuntu/Debug/source/Shader/FurShaderBase.o: In function `Fsl::FurShaderBase::Construct(int)':

/home/user/fsl-gpu-sdk-2.2/DemoApps/GLES3/T3DStressTest/source/Shader/FurShaderBase.cpp:236: undefined reference to `Fsl::GLES3::GLValues::INVALID_UNIFORM_LOCATION'

/home/user/fsl-gpu-sdk-2.2/DemoApps/GLES3/T3DStressTest/source/Shader/FurShaderBase.cpp:237: undefined reference to `Fsl::GLES3::GLValues::INVALID_UNIFORM_LOCATION'

The failure is due caused by not providing a definition for `INVALID_UNIFORM_LOCATION`.

`std::fill()` expect a variable with a definition.

 

Reference:

http://stackoverflow.com/questions/16957458/static-const-in-c-class-undefined-reference

http://stackoverflow.com/questions/1312241/using-a-static-const-int-in-a-struct-class/1312267#1312267

Outcomes