Jump to content
  • Advertisement
Sign in to follow this  
genovacle

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

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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

Share this post


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

Share this post


Link to post
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 this post


Link to post
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 this post


Link to post
Share on other sites
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.def
glut.h
glut32.dll
glut32.lib
README-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).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!