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

This topic is 5031 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

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!

Share on other sites
OK, i've managed to get simple working, by

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!

Share on other sites
Quote:
 Original post by genovacleOK, i've managed to get simple working, by a) adding glut32.dll to sys32b) adding glut.h to the compiler libc) specify to include opengl32.lib in the project linker propertiesTHERE 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

Share on other sites
Quote:
 Original post by genovacleOK, i've managed to get simple working, by a) adding glut32.dll to sys32b) adding glut.h to the compiler libc) specify to include opengl32.lib in the project linker propertiesTHERE 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.

Share on other sites
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?

Share on other sites
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).

Share on other sites
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.

Share on other sites
One word (or is it 2?) freeglut...on sourceforge. Its newer....

J

Share on other sites
whats wrong with SDL?

Share on other sites
Quote:
 Original post by genovacleyea 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).

1. 1
Rutin
69
2. 2
3. 3
4. 4
5. 5

• 21
• 10
• 33
• 20
• 9
• Forum Statistics

• Total Topics
633431
• Total Posts
3011834
• Who's Online (See full list)

There are no registered users currently online

×