I’m wanting to learn Open GL and do so within the Visual C environment. However, I’m having immense trouble getting it to work. I’ve downloaded a piece of sample OpenGL code, but when I compile I get this error:
1>------ Build started: Project: OpenGLTest2, Configuration: Debug Win32 ------
1>Compiling…
1>main.cpp
1>f:\documents\visual studio 2008\projects\opengltest2\opengltest2\main.cpp(1) : fatal error C1083: Cannot open type library file: ‘c:\program files\microsoft sdks\windows\v6.0a\include\gl\gl.h’: Error loading type library/DLL.
1>Build log was saved at “file://f:\Documents\Visual Studio 2008\Projects\OpenGLTest2\OpenGLTest2\Debug\BuildLog.htm”
1>OpenGLTest2 - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
The problem is, probably, in the fact that you have downloaded VS 6.0 project and trying to build it on VS 2K8. VS2K8 is not shipped with GL supporting files. There is no INCLUDE\GL folder. If you don’t have VS 6.0 installed, you have to download header and library files.
The thing is he’s using the “#import” directive instead of “#include” . He has the gl.h file alright. Here are some tests under vs2k8:
#include <gl\gl444.h> // main.cpp(1) : fatal error C1083: Cannot open include file: ‘gl\gl444.h’: No such file or directory #import <gl\gl.h> // main.cpp(1) : fatal error C1083: Cannot open type library file: ‘c:\program files\microsoft sdks\windows\v6.0a\include\gl\gl.h’: Error loading type library/DLL.
#import <gl\gl555.h> // main.cpp(1) : fatal error C1083: Cannot open type library file: ‘gl\gl555.h’: No such file or directory