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

build-example may fail linking with glu 9.0.2 #464

Open
zephvr opened this issue Aug 3, 2021 · 2 comments
Open

build-example may fail linking with glu 9.0.2 #464

zephvr opened this issue Aug 3, 2021 · 2 comments

Comments

@zephvr
Copy link

zephvr commented Aug 3, 2021

Summary

With Mesa OpenGL utility library (GLU) version 9.0.2 installed, running make build-example can fail with error like undefined reference to symbol 'glEnd' or undefined reference to symbol 'glEnable'.

A complete output can be found here https://pastebin.com/ALfiRkw4

Details

This is an issue with glu version 9.0.2 and may affect different distributions (Archlinux in my case)

I added MAY because it only appear when building glu using meson and not make. Indeed while using meson the pkgconfig file generated is malformed and contains a Requires.private: opengl instead of Requires: opengl field. This lead to the command pkg-config --libs glu to ommit the -lGL argument. Hence a linking error.

This issue have already been fix on the glu repo with this commit We just have to wait for the next glu release.

Quick fix

A temporary fix while an official version is release is to edit Makefile.opengl and add a --static argument to pkg-config --libs glu commands

This gives:
LDFLAGS += ${shell pkg-config --libs --static glu} -lglut

@Berlinuxer
Copy link

Hello,
after i've edited the Makefile.opengl, i got the errormessages that ld cannot find -lGLU and -lglut. I am driving archlinux as well, and it is uptodate. Are there any other errors, or is it my linux, are there other packeges i need to install?

@doppioandante
Copy link

doppioandante commented Nov 19, 2022

Hi, I got the same problem with the build-parts part of the make process.
My system is Ubuntu 22.04 for reference.
The fix I adopted was:

CPPFLAGS	+= ${shell pkg-config --cflags glu gl}
LDFLAGS 	+= ${shell pkg-config --libs glu gl} -lglut

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants