Page 1 of 1

linking errors with eglGetProcAddress

Posted: Mon Mar 25, 2019 2:34 pm
by Brian Beuken
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 'dlsym@@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?

Re: linking errors with eglGetProcAddress

Posted: Mon Mar 25, 2019 2:58 pm
by Brian Beuken
ah...
seems you need to include the libdl library

obvious when you see it....confusing as hell when you don't.

Re: linking errors with eglGetProcAddress

Posted: Sat May 04, 2019 6:46 am
by johannesl
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.