# Building Sample PVRShell Program

**URL:** <https://forums.imgtec.com/t/building-sample-pvrshell-program/1811>\
**Category:** PowerVR Insider\
**Created:** [June 11, 2013, 3:30am UTC](https://forums.imgtec.com/t/building-sample-pvrshell-program/1811 "2013-06-11T03:30:37Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![hellboy](https://avatars.discourse-cdn.com/v4/letter/h/48db29/32.png) [@hellboy](https://forums.imgtec.com/u/hellboy)\
**Post date:** [June 11, 2013, 3:30am UTC](https://forums.imgtec.com/t/building-sample-pvrshell-program/1811/1 "2013-06-11T03:30:37Z")

</div>

Hi. I am trying to build a sample program given in Examples folder in the SDK but I can’t find any makefile or configure file. Can anyone tell me how can I build any sample program from its code ?

---

<div class="post-metadata">

**Author:** ![dgu](https://avatars.discourse-cdn.com/v4/letter/d/94ad74/32.png) [@dgu](https://forums.imgtec.com/u/dgu)\
**Post date:** [June 11, 2013, 6:16am UTC](https://forums.imgtec.com/t/building-sample-pvrshell-program/1811/2 "2013-06-11T06:16:22Z")

</div>

Hello  
  
  
  
in the documentation sdk , InstallationSection.html page describe everything !!!  
  
  
  
regards  
  
david

---

<div class="post-metadata">

**Author:** ![hellboy](https://avatars.discourse-cdn.com/v4/letter/h/48db29/32.png) [@hellboy](https://forums.imgtec.com/u/hellboy)\
**Post date:** [June 12, 2013, 2:31am UTC](https://forums.imgtec.com/t/building-sample-pvrshell-program/1811/3 "2013-06-12T02:31:42Z")

</div>

Thanks for the reply. But I have a doubt in the very first step.  
  
"Define the TOOLCHAIN environment variable to the toolchain directory, or add the path to the toolchain to the PATH environment variable (i.e. run export PATH=“path to the toolchain:$PATH”)."  
  
What is a TOOLCHAIN and where can I find it ? Sorry for the silly doubt but I am new to all this.

---

<div class="post-metadata">

**Author:** ![dgu](https://avatars.discourse-cdn.com/v4/letter/d/94ad74/32.png) [@dgu](https://forums.imgtec.com/u/dgu)\
**Post date:** [June 12, 2013, 10:49am UTC](https://forums.imgtec.com/t/building-sample-pvrshell-program/1811/4 "2013-06-12T10:49:09Z")

</div>

that is cool that you start by using this wonderfull SDK .  
  
by my side :  
  
export PATH=/home/dgu/2015sdk/SDK\_3.1:$PATH  
  
make PLATFORM=Linux\_x86\_32 X11BUILD=1  
  
  
  
and everything compile and run  
  
  
  
  
  
g++ -c -DBUILD\_OGLES2 -DRELEASE -O2 -m32 -march=i686 -I/home/dgu/2015sdk/SDK\_3.1/Builds/Include -I/home/dgu/2015sdk/SDK\_3.1/Shell -I/home/dgu/2015sdk/SDK\_3.1/Shell/API/KEGL -I/home/dgu/2015sdk/SDK\_3.1/Shell/OS/LinuxX11 -I/home/dgu/2015sdk/SDK\_3.1/Tools/OGLES2 -I/usr/include/X11/include /home/dgu/2015sdk/SDK\_3.1/Shell/OS/LinuxX11/PVRShellOS.cpp -o…/Linux\_x86\_32/ReleaseX11/PVRShellOS.o  
  
g++ -o …/Linux\_x86\_32/ReleaseX11/OGLES2AlphaTest …/Linux\_x86\_32/ReleaseX11/OGLES2AlphaTest.o …/Linux\_x86\_32/ReleaseX11/TexFragShader.o …/Linux\_x86\_32/ReleaseX11/DiscardFragShader.o …/Linux\_x86\_32/ReleaseX11/VertShader.o …/Linux\_x86\_32/ReleaseX11/Wallwire.o …/Linux\_x86\_32/ReleaseX11/PVRShell.o …/Linux\_x86\_32/ReleaseX11/PVRShellAPI.o …/Linux\_x86\_32/ReleaseX11/PVRShellOS.o -m32 -L/usr/include/X11/lib -lX11 -lXau -lGLESv2 -lEGL -L/home/dgu/2015sdk/SDK\_3.1/Tools/OGLES2/Build/LinuxGeneric/…/Linux\_x86\_32/ReleaseX11 -logles2tools -L"/home/dgu/2015sdk/SDK\_3.1/Builds/Linux/x86\_32/Lib" -Wl,–rpath-link,"/home/dgu/2015sdk/SDK\_3.1/Builds/Linux/x86\_32/Lib"  
  
  
  
i am using codelite under linux as well , you can copy the shell classes in your project and setting include directoy and linking information as well , it s then fast to setup your project.  
  
  
  
Its really a matter of taste and opinion about preferences 🙂

---

<div class="post-metadata">

**Author:** ![hellboy](https://avatars.discourse-cdn.com/v4/letter/h/48db29/32.png) [@hellboy](https://forums.imgtec.com/u/hellboy)\
**Post date:** [June 12, 2013, 11:38am UTC](https://forums.imgtec.com/t/building-sample-pvrshell-program/1811/5 "2013-06-12T11:38:30Z")

</div>

I have some more doubts. I 'll list them all :

1. You did a X11 build, then why didn’t you perform the second step i.e. “export X11ROOT=/usr/X11R6\_SGX”.  
  
  
2. According to your first command, is the location of the toolchain the SDK\_3.1 directory present in the Imagination SDK installation folder i.e. (C:ImaginationPowerVRGraphicsSDKSDK\_3.1) ?  
  
  
3. According to your machine, the first line printed after doing make has -march=i686 -I **toolchain-directory** /Builds/Include… But I set my toolchain directory as **/usr/ig86-pc-cygwin/bin** and after doing make, my first line which is printed contains :  
  
-march=i686 -I/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK\_3.1/Builds/Include…  
  
  
  
g++ -DBUILD\_OGLES2 -DRELEASE -O2 -m32 -march=i686 -I/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK\_3.1/Builds/Include -I/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK\_3.1/Shell -I/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK\_3.1/Shell/API/KEGL -I/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK\_3.1/Shell/OS/LinuxX11 -I/usr/X11R6\_SGX/include -MF"…/Linux\_x86\_32/ReleaseX11/OGLES2IntroducingPVRShell.d" -MG -MM -MP -MT"…/Linux\_x86\_32/ReleaseX11/OGLES2IntroducingPVRShell.d" -MT"…/Linux\_x86\_32/ReleaseX11/OGLES2IntroducingPVRShell.o" "…/…/OGLES2IntroducingPVRShell.cpp"  
  
g++ -c -DBUILD\_OGLES2 -DRELEASE -O2 -m32 -march=i686 -I/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK\_3.1/Builds/Include -I/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK\_3.1/Shell -I/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK\_3.1/Shell/API/KEGL -I/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK\_3.1/Shell/OS/LinuxX11 -I/usr/X11R6\_SGX/include …/…/OGLES2IntroducingPVRShell.cpp -o…/Linux\_x86\_32/ReleaseX11/OGLES2IntroducingPVRShell.o  
  
  
4. I also perform the second step i.e. “export X11ROOT=/usr/X11R6\_SGX”. My make finally fails and throws the error : **ld cannot find -lGLESv2**  
  
  
  
g++ -o …/Linux\_x86\_32/ReleaseX11/OGLES2IntroducingPVRShell …/Linux\_x86\_32/ReleaseX11/OGLES2IntroducingPVRShell.o …/Linux\_x86\_32/ReleaseX11/PVRShell.o …/Linux\_x86\_32/ReleaseX11/PVRShellAPI.o …/Linux\_x86\_32/ReleaseX11/PVRShellOS.o -m32 -L/usr/X11R6\_SGX/lib -lX11 -lXau -lGLESv2 -lEGL -L"/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK\_3.1/Builds/Linux/x86\_32/Lib" -Wl,–rpath-link,"/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK\_3.1/Builds/Linux/x86\_32/Lib"  
  
…/…/…/…/…/…/Builds/Linux/make\_example.mak:46: recipe for target `…/Linux\_x86\_32/ReleaseX11/OGLES2IntroducingPVRShell’ failed  
  
  
  
I set my LD\_LIBRARY\_PATH variable to contain the directory containing the **libGLESv2.so** file in the Builds folder in the SDK but nothing happens.  
  
  
  
  
  
Can you please tell where am I going wrong ?  
  
Thanks.

---

<div class="post-metadata">

**Author:** ![dgu](https://avatars.discourse-cdn.com/v4/letter/d/94ad74/32.png) [@dgu](https://forums.imgtec.com/u/dgu)\
**Post date:** [June 12, 2013, 12:15pm UTC](https://forums.imgtec.com/t/building-sample-pvrshell-program/1811/6 "2013-06-12T12:15:46Z")

</div>

hi,  
  
i use of course Linux Ubuntu 🙂  
  
  
  
if your are using window why not use visual studio ?  
  
  
  
about your question  
  
1/ it s already in my path and my gnu toolchain as well.  
  
are you able to compile ?  
  
  
  
about step 4  
  
set YOUR LIBRARYPATH in my case :/home/dgu/2015sdk/SDK\_3.1/Builds/Linux/x86\_32/Lib  
  
export LD\_LIBRARY\_PATH=YOUR LIBRARYPATH into /etc/bash.profile  
  
  
  
kind regards  
  
david

---

<div class="post-metadata">

**Author:** ![hellboy](https://avatars.discourse-cdn.com/v4/letter/h/48db29/32.png) [@hellboy](https://forums.imgtec.com/u/hellboy)\
**Post date:** [June 13, 2013, 3:21am UTC](https://forums.imgtec.com/t/building-sample-pvrshell-program/1811/7 "2013-06-13T03:21:02Z")

</div>

Yes, I am able to compile and generate the following files :  
  
  
  
OGLES2IntroducingPVRShell.d  
  
OGLES2IntroducingPVRShell.o  
  
PVRShell.d  
  
PVRShell.o  
  
PVRShellAPI.d  
  
PVRShellAPI.o  
  
PVRShellOS.d  
  
PVRShellOS.o  
  
  
  
But the final linking step to create an executable fails.  
  
  
  
I exported LD\_LIBRARY\_PATH to /etc/profile but still it cannot find **libGLESv2.so**  
  
  
  
Is it due to because I did **export X11ROOT=/usr/X11R6\_SGX** and after **make PLATFORM=Linux\_x86\_32 X11BUILD=1** , it searches for “GLESv2” in **/usr/X11R6\_SGX/lib** and when I do “ls” in /usr, I don’t see any “X11R6\_SGX” directory.  
  
  
  
g++ -o …/Linux\_x86\_32/ReleaseX11/OGLES2IntroducingPVRShell …/Linux\_x86\_32/ReleaseX11/OGLES2IntroducingPVRShell.o …/Linux\_x86\_32/ReleaseX11/PVRShell.o …/Linux\_x86\_32/ReleaseX11/PVRShellAPI.o …/Linux\_x86\_32/ReleaseX11/PVRShellOS.o -m32 -L **/usr/X11R6\_SGX/lib -lX11 -lXau -lGLESv2 -lEGL** -L"/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK\_3.1/Builds/Linux/x86\_32/Lib" -Wl,–rpath-link,"/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK\_3.1/Builds/Linux/x86\_32/Lib"  
  
…/…/…/…/…/…/Builds/Linux/make\_example.mak:46: recipe for target `…/Linux\_x86\_32/ReleaseX11/OGLES2IntroducingPVRShell’ failed  
  
  
  
Do I also need to include /cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK\_3.1ToolsOGLES2/Build/Linux\_x86\_32/ReleaseX11/libogles2tools.a  
  
to any library path ?  
  
  
  
I will finally be running the application on a PandaBoard.

---

<div class="post-metadata">

**Author:** ![dgu](https://avatars.discourse-cdn.com/v4/letter/d/94ad74/32.png) [@dgu](https://forums.imgtec.com/u/dgu)\
**Post date:** [June 13, 2013, 5:17am UTC](https://forums.imgtec.com/t/building-sample-pvrshell-program/1811/8 "2013-06-13T05:17:45Z")

</div>

Hello  
  
  
  
i see,  
  
yes include this lib as well  
  
the mandatory lib under linux X11 ARE :  
  
GLESv2;EGL;X11  
  
  
  
the /usr/X11R6\_SGX given in the doc are just a sample. i do not have this directoy, maybe this should be removed because it s not clear.

---

<div class="post-metadata">

**Author:** ![hellboy](https://avatars.discourse-cdn.com/v4/letter/h/48db29/32.png) [@hellboy](https://forums.imgtec.com/u/hellboy)\
**Post date:** [June 13, 2013, 6:24am UTC](https://forums.imgtec.com/t/building-sample-pvrshell-program/1811/9 "2013-06-13T06:24:36Z")

</div>

Nothing happened even after including the path of **libogles2tools.a** to LD\_LIBRARY\_PATH and LIB\_PATH. is there something else that I am missing ?

---

<div class="post-metadata">

**Author:** ![dgu](https://avatars.discourse-cdn.com/v4/letter/d/94ad74/32.png) [@dgu](https://forums.imgtec.com/u/dgu)\
**Post date:** [June 13, 2013, 7:20am UTC](https://forums.imgtec.com/t/building-sample-pvrshell-program/1811/10 "2013-06-13T07:20:27Z")

</div>

if the library is in the ld path then this error should not happend , it s seems that the ld path is wrong .  
  
You mention that -L/usr/X11R6\_SGX/lib doesnt exist in your machine , then you should remove it.  
  
the directory you mention is then wrong .  
  
some helper  
  
[http://www.gnu.org/software/libtool/](http://www.gnu.org/software/libtool/)

---

<div class="post-metadata">

**Author:** ![hellboy](https://avatars.discourse-cdn.com/v4/letter/h/48db29/32.png) [@hellboy](https://forums.imgtec.com/u/hellboy)\
**Post date:** [June 13, 2013, 7:33am UTC](https://forums.imgtec.com/t/building-sample-pvrshell-program/1811/11 "2013-06-13T07:33:17Z")

</div>

I had removed X11R6\_SGX. Now, the X11ROOT is /usr .

---

<div class="post-metadata">

**Author:** ![dgu](https://avatars.discourse-cdn.com/v4/letter/d/94ad74/32.png) [@dgu](https://forums.imgtec.com/u/dgu)\
**Post date:** [June 13, 2013, 7:33am UTC](https://forums.imgtec.com/t/building-sample-pvrshell-program/1811/12 "2013-06-13T07:33:44Z")

</div>

does it work for you ? you should be very close now

---

<div class="post-metadata">

**Author:** ![hellboy](https://avatars.discourse-cdn.com/v4/letter/h/48db29/32.png) [@hellboy](https://forums.imgtec.com/u/hellboy)\
**Post date:** [June 13, 2013, 7:34am UTC](https://forums.imgtec.com/t/building-sample-pvrshell-program/1811/13 "2013-06-13T07:34:40Z")

</div>

No, it didn’t .

---

<div class="post-metadata">

**Author:** ![dgu](https://avatars.discourse-cdn.com/v4/letter/d/94ad74/32.png) [@dgu](https://forums.imgtec.com/u/dgu)\
**Post date:** [June 13, 2013, 7:38am UTC](https://forums.imgtec.com/t/building-sample-pvrshell-program/1811/14 "2013-06-13T07:38:01Z")

</div>

what is the error then ?  
  
does it compile ?

---

<div class="post-metadata">

**Author:** ![dgu](https://avatars.discourse-cdn.com/v4/letter/d/94ad74/32.png) [@dgu](https://forums.imgtec.com/u/dgu)\
**Post date:** [June 13, 2013, 7:39am UTC](https://forums.imgtec.com/t/building-sample-pvrshell-program/1811/15 "2013-06-13T07:39:18Z")

</div>

your Ld path should contain where the lib are with correct path.

---

<div class="post-metadata">

**Author:** ![dgu](https://avatars.discourse-cdn.com/v4/letter/d/94ad74/32.png) [@dgu](https://forums.imgtec.com/u/dgu)\
**Post date:** [June 13, 2013, 7:44am UTC](https://forums.imgtec.com/t/building-sample-pvrshell-program/1811/16 "2013-06-13T07:44:29Z")

</div>

export X11ROOT=/usr/include/X11  
  
  
  
make PLATFORM=Linux\_x86\_32 X11BUILD=1  
  
  
  
and it work for me

---

<div class="post-metadata">

**Author:** ![hellboy](https://avatars.discourse-cdn.com/v4/letter/h/48db29/32.png) [@hellboy](https://forums.imgtec.com/u/hellboy)\
**Post date:** [June 13, 2013, 7:56am UTC](https://forums.imgtec.com/t/building-sample-pvrshell-program/1811/17 "2013-06-13T07:56:38Z")

</div>

It compiles. Thats how I get all the .o’s and .d’s.  
  
  
  
The above commands didn’t work for me. What I keep on getting is this :  
  
  
  
/usr/lib/gcc/i686-pc-cygwin/4.5.3/…/…/…/…/i686-pc-cygwin/bin/ld: cannot find -lGLESv2

---

<div class="post-metadata">

**Author:** ![dgu](https://avatars.discourse-cdn.com/v4/letter/d/94ad74/32.png) [@dgu](https://forums.imgtec.com/u/dgu)\
**Post date:** [June 13, 2013, 7:58am UTC](https://forums.imgtec.com/t/building-sample-pvrshell-program/1811/18 "2013-06-13T07:58:17Z")

</div>

Did you add the path linking to the library DIRECTORY after the -L ??

---

<div class="post-metadata">

**Author:** ![hellboy](https://avatars.discourse-cdn.com/v4/letter/h/48db29/32.png) [@hellboy](https://forums.imgtec.com/u/hellboy)\
**Post date:** [June 13, 2013, 8:01am UTC](https://forums.imgtec.com/t/building-sample-pvrshell-program/1811/19 "2013-06-13T08:01:42Z")

</div>

I added the path in the /etc/profile as :  
  
  
  
LD\_LIBRARY\_PATH=$LD\_LIBRARY\_PATH:/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK\_3.1/Builds/Linux/x86\_32/Lib  
  
export LD\_LIBRARY\_PATH  
  
  
  
LD\_LIBRARY\_PATH=$LD\_LIBRARY\_PATH:/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK\_3.1/Tools/OGLES2/Build/Linux\_x86\_32/ReleaseX11/  
  
export LD\_LIBRARY\_PATH  
  
  
  
LIB\_PATH=$LIB\_PATH:/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK\_3.1/Tools/OGLES2/Build/Linux\_x86\_32/ReleaseX11/  
  
export LIB\_PATH

---

<div class="post-metadata">

**Author:** ![dgu](https://avatars.discourse-cdn.com/v4/letter/d/94ad74/32.png) [@dgu](https://forums.imgtec.com/u/dgu)\
**Post date:** [June 13, 2013, 8:12am UTC](https://forums.imgtec.com/t/building-sample-pvrshell-program/1811/20 "2013-06-13T08:12:34Z")

</div>

LD\_LIBRARY\_PATH is wrong

> I added the path in the /etc/profile as :  
>   
>   
>   
> LD\_LIBRARY\_PATH=$LD\_LIBRARY\_PATH:/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK\_3.1/Builds/Linux/x86\_32/Lib  
>   
> export LD\_LIBRARY\_PATH  
>   
>   
>   
> LD\_LIBRARY\_PATH=$LD\_LIBRARY\_PATH:/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK\_3.1/Tools/OGLES2/Build/Linux\_x86\_32/ReleaseX11/  
>   
> export LD\_LIBRARY\_PATH  
>   
>   
>   
> LIB\_PATH=$LIB\_PATH:/cygdrive/c/Imagination/PowerVR/GraphicsSDK/SDK\_3.1/Tools/OGLES2/Build/Linux\_x86\_32/ReleaseX11/  
>   
> export LIB\_PATH

[Next page](https://forums.imgtec.com/t/building-sample-pvrshell-program/1811.md?page=2)
