# developing on gentoo - shader compile or link fail

**URL:** <https://forums.imgtec.com/t/developing-on-gentoo-shader-compile-or-link-fail/1422>\
**Category:** PowerVR Insider\
**Created:** [May 24, 2012, 7:07am UTC](https://forums.imgtec.com/t/developing-on-gentoo-shader-compile-or-link-fail/1422 "2012-05-24T07:07:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![funzx](https://avatars.discourse-cdn.com/v4/letter/f/258eb7/32.png) [@funzx](https://forums.imgtec.com/u/funzx)\
**Post date:** [May 24, 2012, 7:07am UTC](https://forums.imgtec.com/t/developing-on-gentoo-shader-compile-or-link-fail/1422/1 "2012-05-24T07:07:24Z")

</div>

\<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  
  
libEGL.so/libGLESv2.so, 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  
  
too.  
  
  
  
  
  
  
  
  
  
Thank you in advance.

---

<div class="post-metadata">

**Author:** ![funzx](https://avatars.discourse-cdn.com/v4/letter/f/258eb7/32.png) [@funzx](https://forums.imgtec.com/u/funzx)\
**Post date:** [May 24, 2012, 3:59pm UTC](https://forums.imgtec.com/t/developing-on-gentoo-shader-compile-or-link-fail/1422/2 "2012-05-24T15:59:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![funzx](https://avatars.discourse-cdn.com/v4/letter/f/258eb7/32.png) [@funzx](https://forums.imgtec.com/u/funzx)\
**Post date:** [May 24, 2012, 6:09pm UTC](https://forums.imgtec.com/t/developing-on-gentoo-shader-compile-or-link-fail/1422/3 "2012-05-24T18:09:15Z")

</div>

Solved it.&nbsp;

---

<div class="post-metadata">

**Author:** ![JoeDavis](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/joedavis/32/71_2.png) [@JoeDavis](https://forums.imgtec.com/u/JoeDavis)\
**Post date:** [May 25, 2012, 8:11am UTC](https://forums.imgtec.com/t/developing-on-gentoo-shader-compile-or-link-fail/1422/4 "2012-05-25T08:11:14Z")

</div>

Hi,  
  
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?

---

<div class="post-metadata">

**Author:** ![funzx](https://avatars.discourse-cdn.com/v4/letter/f/258eb7/32.png) [@funzx](https://forums.imgtec.com/u/funzx)\
**Post date:** [May 26, 2012, 7:11pm UTC](https://forums.imgtec.com/t/developing-on-gentoo-shader-compile-or-link-fail/1422/5 "2012-05-26T19:11:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![JoeDavis](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/joedavis/32/71_2.png) [@JoeDavis](https://forums.imgtec.com/u/JoeDavis)\
**Post date:** [May 28, 2012, 8:32am UTC](https://forums.imgtec.com/t/developing-on-gentoo-shader-compile-or-link-fail/1422/6 "2012-05-28T08:32:13Z")

</div>

Ah, ok. Thanks for letting us know 🙂
