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

Boris Kolpackov boris at codesynthesis.com
Sat Aug 10 17:59:36 UTC 2019


Markus Pawellek <markuspawellek at gmail.com> writes:

> 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.

I don't think this is what's happening. Libs.private lists libraries
that must be linked in addition to Libs when linking to the static OpenGL
library. Requires and Requires.private, on the other hand, is pkg-config's
own (misguided, IMO) dependency management feature. So in order to load
gl.pc one must have .pc files for all the libraries listed in Requires.


> If yes, what would be the best way to link to OpenGL?

I think the easiest way to resolve this is to make sure those .pc files
are installed. On Debian-based systems they normally come in the -dev
packages, along with headers. I am not sure about Arch.



More information about the users mailing list