sebf
sebf

Reputation: 2952

How do I find the glx library name?

I am trying to use a glX function (glXSwapIntervalMESA()) but the compiler is returning an undefined reference error.

I have tried linking with X11 and Xext, and glx, though the last library apparently does not exist. libGL includes some entry points for glx, but I would guess that others (e.g. the one I am trying to use) are platform dependent*.

I cannot find anywhere though which will tell me how to find the names of these platform dependent libraries. For a given system, how do I determine the linker settings in order to use glx?

(*I would guess this because I have seen example linker settings with odd library names.)

Upvotes: 2

Views: 889

Answers (1)

user1629823
user1629823

Reputation:

The function you want to use is an extension function, and you will need to dynamically load it to a function pointer. I would suggest using any one the available extension loader libraries (glew, gl3w, glad...) to help simplifying this process. Alternatively, consider a higher level library like SDL which takes care of a lot of things for you, which should include swapping like in this case.

Upvotes: 3

Related Questions