This seems to be common and an ancient , not current , post / question.
is there a sudo apt udate OpenGL ? _ to keep Linux OpenGL current ?
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)??
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.
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.
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.