OpenGL Libraries

Sid Kraft 46 Reputation points
2026-07-07T13:22:32.5433333+00:00

Have downloaded the file glut-3.7 which contains OpenGL support files. However, when I set the compiler and linker files to access elements in the library, I consistently get errors trying to open the .obj files, apparently do not exist in any of the .dll file nor .lib files. How does one create the .obj files from the contents provided in these files?

Developer technologies | C++
Developer technologies | C++

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.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Taki Ly (WICLOUD CORPORATION) 2,640 Reputation points Microsoft External Staff Moderator
    2026-07-08T03:07:30.2533333+00:00

    Hello @Sid Kraft ,

    I was looking at the issue you mentioned with the glut-3.7 library, and it seems like there might be a slight misunderstanding about how the compiler and linker handle these file types.

    Generally speaking, it might help to think of a .lib file as a sort of archive file that already contains compiled .obj files inside it. Because of this, you usually wouldn't need to manually create or extract .obj files from it. As long as your project's linker is pointed to the .lib file, it can typically access whatever internal .obj files it needs to build the program.

    If you are seeing errors about missing .obj files, it might be possible that a .dll file (like glut32.dll) or an .obj file was accidentally entered into your linker settings instead of the .lib file. When trying to use a DLL in a standard C++ project, it's generally required to link against its corresponding import library (.lib) rather than the DLL itself. The .dll file is usually only needed later, when you actually run the program.

    To help clarify what files the linker actually expects as inputs, I suggest taking a look at this Microsoft documentation page:

    As a quick side note, since GLUT 3.7 is quite old, it might also be worth looking into a more modern alternative like FreeGLUT, which uses the same syntax. Sometimes newer IDEs can occasionally have trouble reading very old pre-compiled libraries.

    I hope this helps provide a bit more context for your setup and points you in the right direction. Let me know if you still have any issues. If you found my response helpful or informative, I would greatly appreciate it if you could follow this guide for your confirmation.

    Thank you.

    Was this answer helpful?

    0 comments No comments

  2. Darran Rowe 2,616 Reputation points
    2026-07-07T14:51:53.3833333+00:00

    You don't. For regular builds, the only .obj files that your project interacts with is the ones generated from your source files. Anything else is obtained from the .lib files that you set the project to link to.

    While there is a little more to it, a .lib file is an archive of .obj files. Think of it as a .zip file if you wish. So setting the linker to the .lib file is enough to provide any extra .obj files that the build requires. This means that if you are seeing any linker errors referencing .obj files then either the SDK that you have downloaded is bad, or you have set something bad as linker input. For example, you have set glut.dll/glut32.dll as a linker input instead of glut.lib/glut32.lib.

    If you are trying to link against a DLL, then you must always link against the import library and not the DLL. But this is an utter guess since you haven't given your actual settings.

    This is also not something written out of ignorance. Just for testing purposes, I have set up a project to use the old GLUT builds, and generally they are fine. There are some 3.7 builds that are bad, but they just give the unresolved symbol linker error.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.