PDA

View Full Version : OpenGL and Visual C++



Julimbob
09-05-2009, 06:34 AM
Hi,

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\BuildL og.htm"
1>OpenGLTest2 - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Any help would be much appricated,

Thanks,

Julimbob

Julimbob
09-06-2009, 06:27 AM
By the way I'm on Vista 64 bit if that helps.

Ilian Dinev
09-06-2009, 11:31 AM
"Cannot open type library file" that's odd. If you didn't have the gl.h file, it would read "fatal error C1083: Cannot open include file"

Post the first line of main.cpp . And of course, try other tutes.

Aleksandar
09-06-2009, 12:22 PM
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.

Ilian Dinev
09-06-2009, 02:27 PM
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