I'm trying to install Urho3D on RPi 3. (GPU = 768 MB)

I installed all the essential dependencies. All the steps went fine. Until this error which occurred during the final make step:

[ 56%] Building CXX object Source/Urho3D/CMakeFiles/Urho3D.dir/Graphics/Skybox.cpp.o
[ 57%] Building CXX object Source/Urho3D/CMakeFiles/Urho3D.dir/Graphics/Graphics.cpp.o
In file included from /root/Urho3D/Source/Urho3D/Graphics/../Graphics/GraphicsImpl.h:29:0,
                 from /root/Urho3D/Source/Urho3D/Graphics/Graphics.cpp:34:
/root/Urho3D/Source/Urho3D/Graphics/../Graphics/OpenGL/OGLGraphicsImpl.h:36:23: fatal error: GLES2/gl2.h: No such file or directory
 #include <GLES2/gl2.h>
compilation terminated.
Source/Urho3D/CMakeFiles/Urho3D.dir/build.make:1916: recipe for target 'Source/Urho3D/CMakeFiles/Urho3D.dir/Graphics/Graphics.cpp.o' failed
make[2]: *** [Source/Urho3D/CMakeFiles/Urho3D.dir/Graphics/Graphics.cpp.o] Error 1
CMakeFiles/Makefile2:1198: recipe for target 'Source/Urho3D/CMakeFiles/Urho3D.dir/all' failed
make[1]: *** [Source/Urho3D/CMakeFiles/Urho3D.dir/all] Error 2
Makefile:137: recipe for target 'all' failed
make: *** [all] Error 2

Any suggestions? What should I do !?

2 Answers 2


The file GLES2/gl2.h belongs to the package called libgles2-mesa-dev, which you should install with apt-get.

  • 2
    I think it is just a missing include path. on Raspbian GLES2 is located in /opt/vc. The Raspberry Pi Foundation has it's own implementation that is specific to the Pi while MESA might not take full advantage of the hardware.
    – kwasmich
    Oct 10, 2016 at 10:13
  • 1
    @kwasmich Hey, thanks - I didn't know about this folder's purpose. Which utterly defeats the purpose of POSIX directory naming, btw. Optional video drivers? Really? Oct 10, 2016 at 10:41
  • 1
    @DmitryGrigoryev I doubt those responsible actually care, I think the secret history of linux on the Pi is that it was a bit grudging but too practical to be avoided ;) Anyway there's a bin directory in there (with stuff like raspicam and vcgencmd) too, but Raspbian probably has that in $PATH and there should be an entry for the linker in /etc/ld.so.conf -- but I do not have a pi to check right now and the OP does not mention an OS. Anyway the upstream source is in the firmware repo: github.com/raspberrypi/firmware (the hardfp version, probably).
    – goldilocks
    Oct 10, 2016 at 13:21
  • 1
    To split hairs a bit: I wouldn't really call openGL a "video driver" BTW, it's a userspace graphics library stacked on top of appropriate drivers, but the two have some significant coupling.
    – goldilocks
    Oct 10, 2016 at 13:27
  • 1
    @Omid1989 So there is a linker entry for the /opt/vc/lib stuff but that file is not there. I would just work with the MESA lib for now. Traditionally on linux it's associated with software emulation of GL hardware, but I am not positive this is necessarily the case currently. That's something you might check with them and/or the Urho3D devs.
    – goldilocks
    Oct 10, 2016 at 22:44

On dec. 29th 2018, with nov. 13th 2018 raspbian stretch full img, this worked:

sudo apt-get install libx11-dev libxrandr-dev libasound2-dev git cmake make libgl1-mesa-dev
mkdir Src
cd Src
git clone https://github.com/urho3d/Urho3D
cd Urho3D
./script/cmake_rpi.sh .

(the rpi specific script takes care of the very special local video driver by declaring the RPI symbol)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.