Imagination PowerVR SDK Blog

How to compile A simple OpenGL ES 2.0 on the pandaboard running ubuntu 12.04 LTS


#1

Hi guys,

i am wondering how do i can compile the the SDK examples on the pandaboard itself

on the other hand i want to compile the code OGLES2HelloAPT_LinuxX11.cpp on the pandaboard running ubuntu 12.04 LTS. do i have to use the associated Makefile in the example ? if so and how ? or there is an other simple way o do it?



Note: The PowerVR SDK was installed on a host linux machine LinuxX86 and i copied the pre-built examples to the pandaboard and was successfully executed


#2

Hi,



You should be able to use the on-device compiler to build the SDK examples. The HelloAPI build process is a little different than other SDK Examples, as it uses standalone Makefiles.



Assuming the 3.3r2 SDK is unpacked to a directory called “pvrSdk” in your Panda’s home, you should be able to build on-device with the following steps:


<br />
cd ~/pvrSdk/SDK_3.3_R2ExamplesBeginner1_HelloAPIOGLES2BuildLinux_armv7hf<br />
make X11BUILD=1 X11ROOT=$PATH_TO_DEVICE_X11_LIBS<br />

```<br />
<br />
In all other Examples, you need to specify the target platform with the <i>PLATFORM</i> flag when calling <i>make</i> (e.g. <i>PLATFORM=Linux_armv7hf</i>)<br />
<br />
When you build on-device, does <i>make</i> produce any errors?<br />
<br />
Regards,<br />
Joe

#3

when i compile with the command you gave me on-device make X11BUILD=1 X11ROOT=/usr i get the following error



/usr/bin/ld: connot find -lEGL

/usr/bin/ld: cannot find -lGLESv2

compilation terminated



is there any change i have to do ?

is this a problem with openGLES2 library not installed on my pandaboard ? if so how to check if it is installed or not ?



thank you very much


#4

the linker (/usr/bin/ld) didnt find the two libraries EGL and GLESv2. add the path to these files to linker search paths. i dont know how to do that in linux. maybe you can use gcc to forward the link (like i do in windows/mingw32).


#5

yes you are right, i had the EGL GLESv2 library installed on my device but it was a problem of linking

i fixed it adding the -L/usr/lib/pvr-omap4-egl to the compiler option



because the OpenGL ESv2 library is installed on that location



thank you very much all



i still have problem of cross compiling the examples if you have any solution please answer the post " How to build the ReleaseX11 examples from the SDK??"