PDA

View Full Version : Where do I put the OpenGL include files?



DaFonz
11-19-2005, 12:52 PM
Basically it's been a while since Ive been programming in school and I just recently downloaded Visual C++ 2005 Express to delve back into it. I searched through the help files and somehow found how to allocate the SDK files to their respected places for lib, header files, etc...

The problem is when I download the OpenGL include files I dont know exactly where to put them or what to do with them or even if im downloading the right thing. Do I have to add each individual file to it's respective directory or is there a precompiled install program that will drop all of the header files into the header file folder for my compiler, all of the lib files into the lib folder for my compiler, etc... one by one?

I know this is very n00b, but the problems I used to encounter weren't usually about the code I wrote, but about the obnoxiously complex compilers and directories. There seems to be very few comprehensive tutorials on the typical methods various compilers do things, all of the programming tutorials I've found dont explain the difference between the various types of projects you can make when you actually try to make a new program, they simply explain how you can make a blank .cpp and associated .h and compile them.

This unexplained void bugs me and makes me wonder if there is an easier way to write my programs.

For example, in Visual C++ 2005 Express, if I try to make a simple "Hello World" program through new project: win32 console application, it wont even compile and run, it seems I have to go in and make a "CLR" project for it to work. Why is this and what is different about a Win32 console project, a CLR empty project and a CLR console application?

I guess I deviated from the original topic a bit on how to be able to utilize the various libraries of prewritten functions that exist out on the internet. I just dont want to remain limited by the same few header files (like math.h and iostream.h etc...), so how do I set it up so I can actually utilize GL\Glut.h?

Oh and sorry about the essay, I was simply having trouble expressing what I was trying to communicate in my current over-caffeinated state.

11-19-2005, 01:14 PM
I haven't played with 2005 yet (official release is slated for the end of the month, i think).

For OpenGL coding, though, you need 3 things:
1. gl.h
2. opengl32.lib
3. opengl32.dll

The header and lib paths for 2003 are something like:
c:\Install\Vc7\PlatformSDK\Include and Lib

Put the dll in Windows\System32.

CLR is .NET's common language run-time, which is not going to be a whole lot of help to you in OpenGL. In fact, it'll probably be more of a hindrance that anything else. But I would think a win32 console app should do it.

11-19-2005, 01:32 PM
You may want to look at GLUT. It makes getting started a breeze (handles basic window creation, input events, and so on).

http://www.xmission.com/~nate/glut.html

DaFonz
11-19-2005, 01:40 PM
Oh yeah, I meant GLUT throughout the whole previous post but for some reason was typing OpenGL. Really I dont know where to place either of the groups of files but Ill try the method posted above and see if I can do it that way.

11-19-2005, 01:46 PM
You can use the same paths for glut, and you can always point the IDE to your stuff through the VS menu Tools->Options->Project->Directories (for 2003, anyway).

DaFonz
11-19-2005, 01:49 PM
Yeah I just downloaded the GLUT source code and after unzipping I got 1121 files... So Im still a bit confused as to what to do with them all.

11-19-2005, 01:56 PM
OK, put glut32.lib and glut.h in the same folders as I mentioned above for OpenGL, or create your own folder somewhere and point the IDE to them. Put the glut32.dll Windows\System32. That's should do it.

DaFonz
11-19-2005, 01:59 PM
Yep I found a place where I can download just the dll, lib, and header GLUT files, so that simplified things a bit. I should know what to do from here, now all I need to do is find opengl.h and its accompanying files to get started.

Thanks a bunch for the help though, really I think its the over-caffeination thats causing my inability to understand simple concepts today ^.^

11-19-2005, 02:00 PM
You probably want to grab the pre-compiled binaries for Windows instead of the source code. There's a readme in the distro that explains where to put everything.

BTW, what ever happened to Swains?

11-19-2005, 02:01 PM
Thanks a bunch for the help though, really I think its the over-caffeination thats causing my inability to understand simple concepts today ^.^No problem :D

11-20-2005, 07:48 AM
now all I need to do is find opengl.h and its accompanying files to get started.You'll probably want to grab the Win32 Platform SDK, if it's not included with the 2005 beta. Otherwise, the OpenGL files should already be there and ready to go.