# Is loading EGL with SDL\_GL\_LoadLibrary undefined behavior?

**URL:** <https://discourse.libsdl.org/t/is-loading-egl-with-sdl-gl-loadlibrary-undefined-behavior/69467>\
**Category:** SDL Development\
**Created:** [October 2, 2026, 1:15pm UTC](https://discourse.libsdl.org/t/is-loading-egl-with-sdl-gl-loadlibrary-undefined-behavior/69467 "2026-10-02T13:15:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AstroArchelon](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/a/74df32/32.png) [@AstroArchelon](https://discourse.libsdl.org/u/AstroArchelon)\
**Post date:** [October 2, 2026, 1:15pm UTC](https://discourse.libsdl.org/t/is-loading-egl-with-sdl-gl-loadlibrary-undefined-behavior/69467/1 "2026-10-02T13:15:00Z")

</div>

While troubleshooting an issue in a popular video game I found that if Wayland is available, the game passes the path to the EGL library (e.g. `/lib/x86_64-linux-gnu/libEGL.so.1`) to `SDL_GL_LoadLibrary`. This succeeds on the Wayland driver but fails on X11 (which SDL uses instead on some Wayland compositors). Is this something you’re not supposed to do?

---

<div class="post-metadata">

**Author:** ![rtrussell](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/rtrussell/32/4768_2.png) [@rtrussell](https://discourse.libsdl.org/u/rtrussell)\
**Post date:** [October 3, 2026, 9:02am UTC](https://discourse.libsdl.org/t/is-loading-egl-with-sdl-gl-loadlibrary-undefined-behavior/69467/2 "2026-10-03T09:02:07Z")

</div>

> [@AstroArchelon](#):
>
> the game passes the path to the EGL library (e.g. `/lib/x86_64-linux-gnu/libEGL.so.1`) to `SDL_GL_LoadLibrary`

Why not [`SDL_LoadObject()`](https://wiki.libsdl.org/SDL2/SDL_LoadObject)?
