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.
The linker error shows it is trying to open a file named GL\.obj, which is wrong. That means the project is treating a path or header name as an object or library dependency.
Key points:
- Headers vs. libraries
- Header files (
.h) go in include directories and are referenced with#include. - The linker only works with
.lib(and.obj) files, not.hfiles.
- Header files (
- Fix the include paths
- In Configuration Properties → C/C++ → General → Additional Include Directories, add the directory that contains the header files, for example:
c:\glut37\glut-3.7\Include - Then include them normally, e.g.:
#include "fgl.h" #include "fglut.h" #include "glut.h" #include "tube.h" - Do not add header paths to linker library directories or dependencies.
- In Configuration Properties → C/C++ → General → Additional Include Directories, add the directory that contains the header files, for example:
- Fix the linker settings
- In Configuration Properties → Linker → General → Additional Library Directories, specify the directory that contains the GLUT
.libfiles, e.g.:
c:\glut37\glut-3.7\LIB - In Configuration Properties → Linker → Input → Additional Dependencies, list only library filenames (like
glut32.libor whatever the package provides). - Remove any entries that look like paths or header names (such as
c:\glut37\glut-3.7\Include\GL\...), because the linker will treat them as library/object names and produce LNK1104.
- In Configuration Properties → Linker → General → Additional Library Directories, specify the directory that contains the GLUT
- Check for path/filename issues
- LNK1104 is commonly caused by incorrect paths or filenames passed to the linker. Review all entries in Additional Dependencies and ensure they are valid library names that exist in the directories specified in Library Directories.
- Verify architecture and library type
- Ensure the GLUT libraries match the project’s target (x86 vs x64). A mismatch can also cause LNK1104 if the wrong directory is referenced.
After these changes, rebuild the project. The compiler will find the headers via the include path, and the linker will only try to open valid .lib files from the library directories, eliminating the GL\.obj error.
References: