Brian Beuken
Posts: 177
Joined: Fri Jan 29, 2016 12:51 pm

linking errors with eglGetProcAddress

Mon Mar 25, 2019 2:34 pm

Returning back to some extension coding. I seem to have hit a strange snag...
I want to set up and test a GL_OES_mapbuffer extension, something I had issues with in the past...
Im doing the normal methods..

PFNGLMAPBUFFEROESPROC glMapBuffer = NULL;
glMapBuffer = (PFNGLMAPBUFFEROESPROC)eglGetProcAddress("GL_OES_mapbuffer");

But.. I'm getting an odd linker error.

1>/usr/bin/ld: /opt/vc/lib/libEGL_static.a(egl_khr_image_client.c.o)(0): error : undefined reference to symbol '[email protected]@GLIBC_2.4'
1>//lib/arm-linux-gnueabihf/libdl.so.2: error adding symbols: DSO missing from command line


Anyone know what this is? My linker options are the same ones I always use
-Wl,-gc-sections

Have I missed something obvious?
Very old computer game programmer, now teaching very young computer game programmers, some very bad habits.
Wrote some book about coding Pi's and SBC's, it's out now...go get it!
http://www.scratchpadgames.net/

Brian Beuken
Posts: 177
Joined: Fri Jan 29, 2016 12:51 pm

Re: linking errors with eglGetProcAddress

Mon Mar 25, 2019 2:58 pm

ah...
seems you need to include the libdl library

obvious when you see it....confusing as hell when you don't.
Very old computer game programmer, now teaching very young computer game programmers, some very bad habits.
Wrote some book about coding Pi's and SBC's, it's out now...go get it!
http://www.scratchpadgames.net/

User avatar
johannesl
Posts: 17
Joined: Thu May 23, 2013 8:38 pm

Re: linking errors with eglGetProcAddress

Sat May 04, 2019 6:46 am

Thanks for sharing!

I can also recommend anyone building stuff that should work outside X11 to link directly with -lbrcmEGL and -lbrcmGLESv2 instead of plain libEGL and libGLESv2. This is also needed when getting older stuff such as ioquake3 to work in the newer Rasbian releases.

Return to “OpenGLES”