Visual Studio.NET can't find GL/glut.h

Started by
11 comments, last by alnite 19 years, 2 months ago
Arrgh. As a DirectX user i am finding it incredibly annoying why VS.NET cannot find any GL headers, i.e GL/glu.h, GL/glut.h. I am trying to compile some CG code, and even with me adding "glut.h" into the header, it cannot find it! All i get when i try to compile OpenGL code - (take the simple OpenGl tutorial) i get cannot open include file <GL/glut.h> can someone explain what is going on as it is annoying!
Advertisement
OK, i've managed to get simple working, by

a) adding glut32.dll to sys32
b) adding glut.h to the compiler lib
c) specify to include opengl32.lib in the project linker properties

THERE HAS TO BE AN EASIER WAY THAN THIS? Isn't there a general framework that does all this? Theres hundreds of header files and .dll's for OpenGL!
Quote:Original post by genovacle
OK, i've managed to get simple working, by

a) adding glut32.dll to sys32
b) adding glut.h to the compiler lib
c) specify to include opengl32.lib in the project linker properties

THERE HAS TO BE AN EASIER WAY THAN THIS? Isn't there a general framework that does all this? Theres hundreds of header files and .dll's for OpenGL!


Hmmm, easier way? This is the standard procedure that is used for just about any C++ program using an exernal library. However, OpenGL is just one library that you just need to include one library and one header file for all the functions, so no need to worry. The reason you have trouble with GLUT is because it is not installed by default. I do not think I even have it, so do not worry. You can if you want make your own project template, but you will not be saving that much time. You will only have to copy the .dll's to the system folder on new library installs. Adding in the necessary libs can be done by using the
#pragma comment (lib,"opengl32.lib") 
command. I think that should work for .Net, but I am not 100% sure. DirectX library is much bigger than OpenGL, and you only need to include maybe 2 or 3 headers for all the functions. The .DLLs are already there as well. Do you kind of see what I mean?

- Drew
Quote:Original post by genovacle
OK, i've managed to get simple working, by

a) adding glut32.dll to sys32
b) adding glut.h to the compiler lib
c) specify to include opengl32.lib in the project linker properties

THERE HAS TO BE AN EASIER WAY THAN THIS? Isn't there a general framework that does all this? Theres hundreds of header files and .dll's for OpenGL!


Hundreds? There are **3**
gl.h
glu.h
glaux.h

if you use glut than it's 4.

that's also 4 libraries : opengl32.lib glu32.lib glaux.lib and glut32.lib :-)

extensions might include 1 or 2 more.

You could write a plugin for VS.NET for a wizard to generate a dummy GLUT or WGL application but really all you need to do is create a template and do a few steps to build a new app from it everytime.
glaux.h is not recognized. Ah well, after further learning apparently GLUT is dated, i am using SDL at the moment.

The thing is, i was trying to compile some CG code, and it required <GL/Glut.h> i added it to the header, but still no luck. I could not find a glut32.dll, any suggestions to make it compile?
Quote:Original post by genovacle
...I could not find a glut32.dll, any suggestions to make it compile?


Install GLUT?

Very first link on a google search for "glut" (That is a hint to try to search for the answers yourself before asking here).
yea thanks for the smart comment. Perhaps when you dl that file you won't find the glut32.lib which is needed. So yea, i've solved the problem. I just hope when you ask me something about dx or c++ i'm not as rude.
One word (or is it 2?) freeglut...on sourceforge. Its newer....

J
whats wrong with SDL?
Quote:Original post by genovacle
yea thanks for the smart comment. Perhaps when you dl that file you won't find the glut32.lib which is needed. So yea, i've solved the problem. I just hope when you ask me something about dx or c++ i'm not as rude.


You're welcome.
The contents of the glut-3.7.6-bin.zip file on that page are...
glut.defglut.hglut32.dllglut32.libREADME-win32.txt


EDIT: By the way, I didn't mean to be rude, it's just that a lot of people who post are too lazy to search for themselves and it gets very annoying pretty quickly. So I apologize if you did search first and for coming off as a smartass (it's hard for me not to sometimes).

This topic is closed to new replies.

Advertisement