Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSMesa build error under Ubuntu 24.04 and OsMesa 24.0.5 #411

Open
kwaegel opened this issue Apr 29, 2024 · 2 comments
Open

OSMesa build error under Ubuntu 24.04 and OsMesa 24.0.5 #411

kwaegel opened this issue Apr 29, 2024 · 2 comments
Labels

Comments

@kwaegel
Copy link

kwaegel commented Apr 29, 2024

I'm trying to build under Ubuntu 24.04 with OsMesa (libosmesa6-dev==24.0.5-1ubuntu1), and getting some APIENTRY definition errors. The regular build without any SYSTEM= definitions works fine.

Steps:

git clone https://github.com/nigels-com/glew.git
cd glew/auto
make
cd ..
make SYSTEM=linux-osmesa

Output (after removing some unrelated warnings):

$ make SYSTEM=linux-osmesa
sed \
        -e "s|@prefix@|/usr/local|g" \
        -e "s|@libdir@|/usr/local/lib64|g" \
        -e "s|@exec_prefix@|/usr/local/bin|g" \
        -e "s|@includedir@|/usr/local/include/GL|g" \
        -e "s|@version@|2.2.0|g" \
        -e "s|@cflags@||g" \
        -e "s|@libname@|GLEW|g" \
        -e "s|@libgl@|-lOSMesa|g" \
        -e "s|@requireslib@|glu|g" \
        < glew.pc.in > glew.pc
cc -DGLEW_NO_GLU -O2 -Wall -W -Wshadow -pedantic -Iinclude -fPIC -Wcast-qual -ansi -pedantic -fno-stack-protector -DGLEW_OSMESA  -o tmp/linux-osmesa/default/shared/glewinfo.o -c src/glewinfo.c
In file included from src/glewinfo.c:41:
/usr/include/GL/osmesa.h:124:29: error: expected ';' after top level declarator
GLAPI OSMesaContext APIENTRY
                            ^
/usr/include/GL/osmesa.h:137:29: error: expected ';' after top level declarator
GLAPI OSMesaContext APIENTRY
                            ^
/usr/include/GL/osmesa.h:166:29: error: expected ';' after top level declarator
GLAPI OSMesaContext APIENTRY
                            ^
/usr/include/GL/osmesa.h:176:12: error: redeclaration of 'APIENTRY' with a different type: 'void' vs 'OSMesaContext' (aka 'struct osmesa_context *')
GLAPI void APIENTRY
           ^
/usr/include/GL/osmesa.h:166:21: note: previous declaration is here
GLAPI OSMesaContext APIENTRY
                    ^
/usr/include/GL/osmesa.h:176:20: error: expected ';' after top level declarator
GLAPI void APIENTRY
                   ^
/usr/include/GL/osmesa.h:208:17: error: redeclaration of 'APIENTRY' with a different type: 'GLboolean' (aka 'unsigned char') vs 'OSMesaContext' (aka 'struct osmesa_context *')
GLAPI GLboolean APIENTRY
                ^
/usr/include/GL/osmesa.h:166:21: note: previous declaration is here
GLAPI OSMesaContext APIENTRY
                    ^
/usr/include/GL/osmesa.h:208:25: error: expected ';' after top level declarator
GLAPI GLboolean APIENTRY
                        ^
/usr/include/GL/osmesa.h:218:29: error: expected ';' after top level declarator
GLAPI OSMesaContext APIENTRY
                            ^
/usr/include/GL/osmesa.h:236:12: error: redeclaration of 'APIENTRY' with a different type: 'void' vs 'OSMesaContext' (aka 'struct osmesa_context *')
GLAPI void APIENTRY
           ^
/usr/include/GL/osmesa.h:218:21: note: previous declaration is here
GLAPI OSMesaContext APIENTRY
                    ^
/usr/include/GL/osmesa.h:236:20: error: expected ';' after top level declarator
GLAPI void APIENTRY
                   ^
/usr/include/GL/osmesa.h:252:12: error: redeclaration of 'APIENTRY' with a different type: 'void' vs 'OSMesaContext' (aka 'struct osmesa_context *')
GLAPI void APIENTRY
           ^
/usr/include/GL/osmesa.h:218:21: note: previous declaration is here
GLAPI OSMesaContext APIENTRY
                    ^
/usr/include/GL/osmesa.h:252:20: error: expected ';' after top level declarator
GLAPI void APIENTRY
                   ^
/usr/include/GL/osmesa.h:267:17: error: redeclaration of 'APIENTRY' with a different type: 'GLboolean' (aka 'unsigned char') vs 'OSMesaContext' (aka 'struct osmesa_context *')
GLAPI GLboolean APIENTRY
                ^
/usr/include/GL/osmesa.h:218:21: note: previous declaration is here
GLAPI OSMesaContext APIENTRY
                    ^
/usr/include/GL/osmesa.h:267:25: error: expected ';' after top level declarator
GLAPI GLboolean APIENTRY
                        ^
/usr/include/GL/osmesa.h:283:17: error: redeclaration of 'APIENTRY' with a different type: 'GLboolean' (aka 'unsigned char') vs 'OSMesaContext' (aka 'struct osmesa_context *')
GLAPI GLboolean APIENTRY
                ^
/usr/include/GL/osmesa.h:218:21: note: previous declaration is here
GLAPI OSMesaContext APIENTRY
                    ^
/usr/include/GL/osmesa.h:283:25: error: expected ';' after top level declarator
GLAPI GLboolean APIENTRY
                        ^
/usr/include/GL/osmesa.h:300:18: error: redeclaration of 'APIENTRY' with a different type: 'OSMESAproc' (aka 'void (*)()') vs 'OSMesaContext' (aka 'struct osmesa_context *')
GLAPI OSMESAproc APIENTRY
                 ^
/usr/include/GL/osmesa.h:218:21: note: previous declaration is here
GLAPI OSMesaContext APIENTRY
                    ^
/usr/include/GL/osmesa.h:300:26: error: expected ';' after top level declarator
GLAPI OSMESAproc APIENTRY
                         ^
/usr/include/GL/osmesa.h:309:12: error: redeclaration of 'APIENTRY' with a different type: 'void' vs 'OSMesaContext' (aka 'struct osmesa_context *')
GLAPI void APIENTRY
           ^
/usr/include/GL/osmesa.h:218:21: note: previous declaration is here
GLAPI OSMesaContext APIENTRY
                    ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Makefile:195: tmp/linux-osmesa/default/shared/glewinfo.o] Error 1
@JRazek
Copy link

JRazek commented Aug 6, 2024

@kwaegel have you solved the issue?

@nigels-com
Copy link
Owner

This workaround seems to fix it.
sudo sed -i 's/APIENTRY//' /usr/include/GL/osmesa.h

It can be undone with:
sudo apt reinstall libosmesa6-dev

But it's not for the faint of heart.

@nigels-com nigels-com added the bug label Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants