Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Nearly a week now, and I can't figure out what's wrong! Any pointers would be appreciated (pun intended)!

Ubuntu 12.04 x86_64

./configure --enable-64-bit --enable-pic -enable-opengl --enable-gles2 --enable-xorg --enable-egl --enable-glu --with-x

(Also tried with the apt-get package of Mesa)

ls /usr/local/lib | grep EGL*  

When running the simple tutorial code

display = eglGetDisplay(EGL_DEFAULT_DISPLAY);  
EGLBoolean err = eglInitialize(display, NULL, NULL);

initialize fails and further functions return EGL_NOT_INITIALIZED.

share|improve this question
apt-get install libxcb-xfixes0-dev libxcb-dri2-0-dev helps building the Mesa. – Vorac Nov 21 '12 at 14:33

1 Answer 1

Under an X desktop, you cannot use EGL_DEFAULT_DISPLAY. You must pass to eglGetDisplay() a pointer to a valid Xlib Display. For example:

EGLBoolean ok;

Display *xlib_dpy = XOpenDisplay(NULL);
if (!xlib_dpy)

EGLDisplay egl_dpy = eglGetDisplay(xlib_dpy);
if (!egl_dpy)

int major;
int minor;
ok = eglInitialize(egl_dpy, &major, &minor);
if (!ok)

if (10 * major + minor != 14) {
  /* EGL is too old; */
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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