OpenGL Libraries

Sid Kraft 76 Reputation points
2026-07-28T22:08:40.1+00:00

Using C++ and OpenGL to output graphics to a window. Have the following headers:

#include <GL\gl.h>

#include <glut.h>

Program accepts successfully.

In the Project Additional Directories:

V++ and C++ "c:\freeglut-3.8.0\include\GL"

I the Project Additional Directories for the Linker:

"c:\glutdlls36"

In the folder c:"\freeglut-3.8.0\include\GL\glut.h

In the folder c:"\glutdlls36\glut LIB file,

                                        glut DLL file, 

                                        glut32 Lib file, 

                                        glut32 DLL file

goodness gracious, certainly have all bases covered. Now getting a linker error, cannot open file c:\glutdlls36.obj

Cannot understand where to get the .obj file that it is looking for! Sid Kraft

Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other

A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.

0 comments No comments

1 answer

Sort by: Most helpful
  1. AI answer

    2026-07-28T22:08:55.9233333+00:00

    The linker is not looking for a real .obj file from GLUT. The path c:\glutdlls36\ was likely added in the wrong linker setting, so Visual Studio is treating that directory as an input file and trying to open it as an object file.

    Use these settings instead:

    1. In C/C++ include settings, add the include directory that contains the GL folder.
      • Example: the parent include path, not the header file itself.
      • Then include the needed headers in code.
    2. In the linker settings, add the library directory only as a library search path.
      • c:\glutdlls36\ belongs in the linker library directory setting, not in additional dependencies.
    3. In the linker input settings, add the actual library file names, for example the appropriate .lib file such as glut32.lib.
      • The linker links against .lib files, not .dll files directly.
    4. Make sure the matching DLL is available when running the app.
      • A DLL can be placed in the same path as the executable, anywhere in the system path, or in a side-by-side assembly.
    5. Verify header names and paths exactly.
      • OpenGL core functions use #include <GL\gl.h>.
      • If a file can’t be found, C1083 commonly means the include path or file name is wrong.

    The key fix is:

    • Library directory: c:\glutdlls36\
    • Additional dependencies: glut32.lib or the correct GLUT .lib file
    • Do not put c:\glutdlls36\ itself in linker input

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

    1 person found this answer helpful.

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.