Summary: | [bisected] Mesa demos fails to link with drawtex.c:34: undefined reference to `glDrawTexfOES' | ||
---|---|---|---|
Product: | Mesa | Reporter: | Scott Moreau <oreaus> |
Component: | Demos | Assignee: | Tapani Pälli <lemody> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | medium | CC: | lemody, sndirsch |
Version: | git | ||
Hardware: | All | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
hopeful patch to fix the issue
drawtex: fixed compiler warnings related to use of eglGetProcAddress |
Description
Scott Moreau
2014-04-30 04:56:43 UTC
did you run make with a clean directory (make clean or git clean -fdX)? (In reply to comment #1) > did you run make with a clean directory (make clean or git clean -fdX)? Yes. demos build and link with mesa dfccd5ccd73ec8e9607826c62fb6bf31f9628719 but linking fails with mesa 1a59f9a131318e1239b47b9ea4fe7c84f461cf37. Created attachment 98234 [details] [review] hopeful patch to fix the issue I'm having problems configuring demos build system to reproduce this ... however for me it seems the reason for failure is that drawtex.c uses function which is not part of opengles1.1 API but an extension function which should be resolved via eglGetProcAddress instead. Attaching a hopeful fix to try. (In reply to comment #3) > Created attachment 98234 [details] [review] [review] > hopeful patch to fix the issue > > I'm having problems configuring demos build system to reproduce this ... No special configuration for demos is needed. As far as I can tell, mesa just needs to be built with gles1 enabled. > however for me it seems the reason for failure is that drawtex.c uses > function which is not part of opengles1.1 API but an extension function > which should be resolved via eglGetProcAddress instead. Attaching a hopeful > fix to try. This patch allows demos to build successfully here. The demos need to use eglGetProcAddress for extension functions. The patch is the right approach, but having a non-static function pointer with the same name as a function is very dangerous. You wouldn't declare 'int (*printf)(const char *, ...);' in your code and expect things to work, would you? :) This is why GLEW names the function pointers __glewFoo and has a #define glFoo that calls it. (In reply to comment #5) > The demos need to use eglGetProcAddress for extension functions. The patch > is the right approach, but having a non-static function pointer with the > same name as a function is very dangerous. You wouldn't declare 'int > (*printf)(const char *, ...);' in your code and expect things to work, would > you? :) > > This is why GLEW names the function pointers __glewFoo and has a #define > glFoo that calls it. That is why I left OES out of the name but I can change it to something better (?) I've send a modified patch to mesa-dev mailing list. fix pushed to master Created attachment 98745 [details]
drawtex: fixed compiler warnings related to use of eglGetProcAddress
Apparently your patch resulted in some compiler warnings. The attached patch fixes them.
(In reply to comment #9) > Created attachment 98745 [details] > drawtex: fixed compiler warnings related to use of eglGetProcAddress > > Apparently your patch resulted in some compiler warnings. The attached patch > fixes them. I assumed egl was already around with 'eglut' but that's not the case. Thanks for the fix, I'll test and commit it soonish. Wonderful. Thanks a lot! compiler warnings patch submitted |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.