I've been diving into OpenGL and using the command `g++ gl.cpp -o gl -lGL -lGLU -lglut` to compile my programs. It works great, but I'm confused about the library names. Some of them are in uppercase like `GL` and `GLU`, while others are in lowercase. I tried searching in `/usr/include/GL`, but I only found files in lowercase. Why are some of these library names capitalized when I can't find any matching files?
2 Answers
You're on the right track by searching in `/usr/include`, but that's where the header files live, which declare the functions. For the actual libraries, you'll want to check out `/usr/lib`. As for the casing, it's just a quirk of naming. There's no strict rule—it's how each library has been established over time. Modern libraries generally use lower case, but OpenGL is from a different era, so it's a mixed bag. Unfortunately, there's no universal manual for library naming; you'll just get familiar with them as you go.
It sounds like you're looking into the OpenGL libraries. If you list out the files in `/usr`, you'd see something like `libGL.so`, which actually points to the library you need. The reason for the difference in case is due to historical naming conventions. Most libraries tend to be lower case nowadays, but older libraries like OpenGL have mixed casing due to their age and the way they were originally named. You don't really need to worry about the case; just stick to how they're referenced when linking.
Related Questions
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically
[Centos] Delete All Files And Folders That Contain a String