Imagination PowerVR SDK Blog

developing on gentoo - shader compile or link fail


<span =“post”>Hello,

I hope this is the place to find OpenGL ES 2.0 coders that do their

programming on Gentoo and can help me with some ideas or solutions to my

problem. I’m using gentoo amd64, nvidia-drivers, all up to date, and I

recently started programming OpenGL ES 2.0 on it, but when running just a

simple example ( 02_IntroducingPVRShell from the PowerVR SDK ) the compiling of the shader fails ( glCompileShader ), the log taken with glGetShaderInfoLog doesn’t give me any information, it contains only garbage data. Also, weird enough is that glGetShaderInfoLog

says that it has written a negative number of bytes into the buffer log

and the log info length is always MAX_SHORT. This happens if I compile

it for x64 ( -m64 flag ); if I compile the program for 32 bits ( -m32

flag ) then both the fragment shader and the vertex shader compiles

properly at runtime, but then the linking fails ( glLinkProgram ) with an empty log.

Does anyone has any idea what could be the cause of this behavior? Or

any suggestion is welcomed; maybe it’s a compile flag I’m missing?

As a side note, the binaries from the PowerVR SDK for

the same example runs properly, so there is no driver or a dependency

problem. It’s just when I compile it myself. I’m not using the Imgtec, but those from mesa, compiled with “gles” use

flag. I checked both my binary and the binary from the sdk with “ldd”,

they both have the same .so dependencies; the binaries from imgtec

runs using the mesa .so libraries, so I doubt that there is a mesa issue


Thank you in advance.


Anyone working on gentoo amd 64? I can send you the project if interested to try it out.


Solved it. 



Sorry for the delay in responding to this. I’m glad to hear that you’ve solved your problem. Were there any specific steps you had to take to get it working correctly?


Hi Joe,

Sorry for not posting the solution. I didn’t because it was just a stupid mistake of mine. I made a skeleton of an app with only PVRShell support and an aditional class derived from it that was instantiated in NewDemo(). Thing was that as I copied the PVRShell sources into my project and I missed the BUILD_OGLES2 directive in one of the headers, and in my class I had included #include <GLES2/gl2.h>. PVRShell was initializing for OpenGL ES 1.1, while in my class I used OpenGL ES 2.0 code. Having the headers included correctly, there were no compile error, but only at runtime.

Cheers, and thank you for trying to help me.


Ah, ok. Thanks for letting us know :slight_smile: