Updating OpenGL - in Linunx , plus C/C++ libraries source / names?

This seems to be common and an ancient , not current , post / question.
IN short

  1. is there a sudo apt udate OpenGL ? _ to keep Linux OpenGL current ?
  2. is there a SIMPLE resource to load / identify required libraries for C++ - to option GCC link to them ?
    AKA -l( library name)
    When I know the library name I can find its path -L etc.
    All for Linux and C/C++

OK I know the libraries names - now for stupid update .

Which LINUX app BUILDS these libraries ?
One of the builders is cygwin - which is Windows app.
Why do I need Windows to build Linux library ( not dll)??

Just use the distro’s package manager.

On openSUSE, for instance, you just run Start -> System -> YaST, and kick an Online Update. You’ll get the latest packages, including any you’ve installed which provide and/or use OpenGL, such as the NVIDIA graphics driver, Mesa3D, OpenGL apps, etc.

This is mostly pretty standarized now. The OpenGL includes and libs (as well a OpenGL-related utilities libraries) are typically in the default include and library search paths. So, if you’re going to compile and link with them manually (as opposed to use something like CMake that just knows where they are and what they’re named), you just do something like this:

g++ -o tst tst.cpp -lglfw -lGLEW -lGL

There may be some variation on this for different distros, but that’s the general template. Of course if you don’t need GLFW or GLEW, don’t link them.

In the usual case, the distro maintaining downloads the source code, builds them, and makes their binaries available by default when you install the distro. Saves you from having to do this. Which app they use is up to them. rpmbuild is one possibility.

You totally lost me here. You were talking about Linux. Then you flipped over to Cygwin, which runs on Windows. I can’t make any sense of your question. You might provide a bit more context as to why you even mentioned Cygwin here. We’re talking about OpenGL support on Linux, not Windows.

Thanks, I am getting the picture now.
I did successfully run this $ glxinfo | grep ‘:’

I mentioned Cygwin becaus I found an article stating that it does build the libraries.
That was very confusing to me also.

One more question
I “included”

#include “GL/freeglut.h”
#include “GL/gl.h”

and added link to “glut” library

Then I received error posted by “freeglut” , which was expected response.

The question is - many sources add more libraries , such as glut32.
Do I need them ?

Cygwin builds libraries like freeglut for usage on Cygwin, just like your distribution builds it. If you’re using functions defined by freeglut, then yes you need to include the header and link to the library. Otherwise, you can leave it out. It might be worth experimenting with link lines (or looking up the home pages/wiki pages of various libraries like glew, glfw, freeglut) to see what each is providing, but typically you’ll know if you’re calling one of these libraries: their functions start with something like glfw or glut.

  • GLEW (“OpenGL Extension Wrangler”) is a bit of a special case because it serves to load up the gl functions (as an extension loader): most usages of OpenGL require linking to the OpenGL library as well as something like GLEW, GLAD, etc.
  • GLFW and freeglut serve similar roles as each other: window and context creation, etc.
  • freeglut’s functions start with glut because it serves as a free (as in freedom) implementation/substitute for the older GLUT library.

The glfw wikipedia page is actually pretty informative on the overall workings.

Hope this helps!

Yes, your post does help.
It seem that a coder starting with a tool is given very terse info as far as libraries go.
And proliferation of “special additions” and “it works on such and such distro” does
not make the start any easier,
So for now I am happy with “just” glut.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.