A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
Hello @Sid Kraft ,
Thanks for your question.
Inside the glut.h file, there is a line of code that says extern "C". This is a special instruction meant only for C++ programs. However, if your main code file in Visual Studio was created with a .c extension instead of a .cpp extension, Visual Studio acts strictly as an older C compiler, gets confused by that command, and throws those errors.
I recommend renaming your source file:
- In your Solution Explorer on the right, find your main code file (it might be named
Source.cormain.c). - Right-click it, select Rename, and change the extension to
.cpp(likemain.cpp).
However, I highly recommend we take a step back.
The reason you keep running into these compiler errors, missing .obj files, and Linker issues is because the glut-3.7 files you downloaded are completely obsolete. Modern Visual Studio struggles to read them properly.
As we discussed in the previous thread, the recommended way to avoid all of this manual troubleshooting is to use the modern vcpkg tool that we set up.
Please consider this approach since Visual Studio will automatically link the modern, correct files for you.
Hope this helps. Thank you so much for your patience.