[build2] Private requirements of pkgconfig and the best way to link to OpenGL

Markus Pawellek markuspawellek at gmail.com
Sat Aug 10 11:52:43 UTC 2019


Hello,

I am working with Arch Linux and GCC 9.1.0.
I wanted to create a small test application running SFML together with
OpenGL.
For this, I used the following lines in my buildfile:

import libs = sfml-all%lib{sfml-graphics}
import libs += gl%lib{gl}
exe{sfml-test}: {hxx cxx}{*} $libs

Both libraries are no packages and should be found via their respective
pkgconfig-files.
Whereas linking to SFML did not introduce any errors, linking to OpenGL
resulted in a bunch of unfound packages, like 'x11', 'xext', 'xdamage', etc.
Observing the respective pkgconfig-file 'gl.pc', I saw an entry
'Requires.private' which was listing nearly all of those unfound packages
and another entry `Libs.private' enabling pthreads.
So build2 seems to link to private requirements of a pkgconfig-file when
importing those.
Is this the desired behavior?
If yes, what would be the best way to link to OpenGL?
Thank you very much in advance.

Greetings
Markus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.build2.org/archives/users/attachments/20190810/b934b95a/attachment.html>


More information about the users mailing list