[Mesa-dev] Scons/GLES: shared_glapi and osmesa link failure

Liviu Prodea liviuprodea at yahoo.com
Thu Oct 18 12:02:36 UTC 2018


scons build=release platform=windows machine=x86 gles=y libgl-gdi osmesa
Creating library build\windows-x86\mesa\drivers\osmesa\osmesa.lib and object build\windows-x86\mesa\drivers\osmesa\osmesa.exp
osmesa.obj : error LNK2001: unresolved external symbol __imp___glapi_check_multithread
osmesa.obj : error LNK2001: unresolved external symbol __imp___glapi_get_proc_address
mesa.lib(context.obj) : error LNK2001: unresolved external symbol __imp___glapi_set_context
mesa.lib(context.obj) : error LNK2001: unresolved external symbol __imp___glapi_set_dispatch
mesa.lib(context.obj) : error LNK2001: unresolved external symbol __imp___glapi_set_nop_handler
mesa.lib(context.obj) : error LNK2001: unresolved external symbol __imp___glapi_new_nop_table
mesa.lib(context.obj) : error LNK2001: unresolved external symbol __imp___glapi_Context
mesa.lib(context.obj) : error LNK2001: unresolved external symbol __imp___glapi_get_dispatch_table_size
mesa.lib(context.obj) : error LNK2001: unresolved external symbol __imp___glapi_get_context
mesa.lib(remap.obj) : error LNK2001: unresolved external symbol __imp___glapi_add_dispatch
mesa.lib(api_loopback.obj) : error LNK2001: unresolved external symbol __imp___glapi_get_dispatch
mesa.lib(api_loopback.obj) : error LNK2001: unresolved external symbol __imp___glapi_Dispatch
build\windows-x86\mesa\drivers\osmesa\osmesa.dll : fatal error LNK1120: 12 unresolved externals
scons: *** [build\windows-x86\mesa\drivers\osmesa\osmesa.dll] Error 1120
st_osmesa.lib(osmesa.obj) : error LNK2001: unresolved external symbol __imp___glapi_get_proc_address
mesa.lib(st_manager.obj) : error LNK2001: unresolved external symbol __imp___glapi_check_multithread
mesa.lib(vbo_exec_api.obj) : error LNK2001: unresolved external symbol __imp___glapi_set_dispatch
mesa.lib(glthread.obj) : error LNK2001: unresolved external symbol __imp___glapi_set_context
mesa.lib(context.obj) : error LNK2001: unresolved external symbol __imp___glapi_get_dispatch_table_size
mesa.lib(remap.obj) : error LNK2001: unresolved external symbol __imp___glapi_add_dispatch
build\windows-x86\gallium\targets\osmesa\osmesa.dll : fatal error LNK1120: 6 unresolved externals
scons: *** [build\windows-x86\gallium\targets\osmesa\osmesa.dll] Error 1120
scons: building terminated because of errors.
This is a long standing issue. First reported here:
https://lists.freedesktop.org/archives/mesa-users/2012-May/000431.html

Encountered again in 2016:
https://lists.freedesktop.org/archives/mesa-users/2016-March/001142.html
and finally by myself in early 2018:
https://bugs.freedesktop.org/show_bug.cgi?id=106843
Eric Engestrom suggested me to try the work in progress Meson build for Windows. Unfortunately it has other issues which prevents it from being ready for prime time as I reported here:
https://gitlab.freedesktop.org/dbaker/mesa/issues/2
I stumbled upon this issue when dealing with this feature request:
https://github.com/pal1000/mesa-dist-win/issues/8
I was able to get that feature done but with a terribly ugly hack which should not even be mentioned.

This issue affects the linking between osmesa and shared_glapi so the build command that triggers it can be as short as:
scons gles=y
or
scons gles=y osmesa
to get to the linking failure as quickly as possible stripping targets that build successfully.
I tried to make a proper fix but it is beyond my skill level, despite having the gut feeling the fix could be something surprisingly simple. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20181018/1db6e332/attachment.html>


More information about the mesa-dev mailing list