I am writing a program that uses the <sys/utsname.h> header and the name functions to display the operating systems name, version, etc. I have included the header and have called the function, however, I am getting fatal errors stating that the header file is not recognized. Everything I have seen online shows the main.cpp file which I have used as an example for my code. Any help to get this header file properly linked would be of much help!
I am currently running on VS, CLion, and on csegrid.
You need to install the package which provides that header file (and much more) first.
Ubuntu:
Fedora:
If you use any other OS, you need to find the correct package using the tools provided with the OS
Then, if you have everything else in place, this should compile and display the information:
Example output from my Ubuntu 20.04 (WSL2):