• Where can I get OpenGL headers?
    23 replies, posted
Hello. I want to start learning OpenGL but I've had an extremely hard time finding the files previously and I've lost them again. Does anyone know where can I get these files: gl.h glut.h glu.h Opengl32.lib glut32.lib glu32.lib Opengl32.dll glut32.dll glu32.dll I've tried downloading Visual C++ but the gl.h that comes with it is broken (at least it gives me 102 errors from just including it). I'm running Windows 7 x64 if that helps.
OpenGL (opengl32.dll, opengl.lib and gl.h) and glu (glu32.dll, glu32.lib and glu.h) come installed with Windows. If you want hardware accelerated OpenGL, simply install the latest drivers for your graphics card. Although it says '32' in the library name, they're actually 64 bit binaries on 64 bit systems. I was able to find pre-compiled glut binaries for Windows in no time; but only 32 bit, 64 bit might be a bit difficult to find pre-compiled. If you can't find it, you'd have to compile your own. If including gl.h gives you errors, try including it as C: [cpp] extern "C" { #include <gl/gl.h> } [/cpp] Of course, this only applies if you're using C++ to begin with. edit: Note that GLUT is not necessary; you can use other libraries like SFML (or CSML, SDL etc in C) for the window creation part as well, they might be easier to find pre-compiled 64 bit Windows binaries for.
They worked just fine for me with MSVS 2010, also Win 7 x64. I didn't get any errors upon including them in my source-files. Mind posting a few?
It's weird, every now and again you get a thread about someone looking for the opengl headers when they are meant to be included in windows by default. :tinfoil:
[url]http://www.xmission.com/~nate/glut/glut-3.7.6-bin.zip[/url] That's for GLut.h GLut.dll and GLut.lib. glut32.dll to %WinDir%\System, glut32.lib to $(MSDevDir)\..\..\VC98\lib, and glut.h to $(MSDevDir)\..\..\VC98\include\GL.
Uh, Visual C++ express edition asks for registration yet microsofts registration page fails to load active content after I enter my details.
Try using IE.
[QUOTE=jA_cOp;20943863]OpenGL (opengl32.dll, opengl.lib and gl.h) and glu (glu32.dll, glu32.lib and glu.h) come installed with Windows. If you want hardware accelerated OpenGL, simply install the latest drivers for your graphics card. Although it says '32' in the library name, they're actually 64 bit binaries on 64 bit systems. I was able to find pre-compiled glut binaries for Windows in no time; but only 32 bit, 64 bit might be a bit difficult to find pre-compiled. If you can't find it, you'd have to compile your own. If including gl.h gives you errors, try including it as C: [cpp] extern "C" { #include <gl/gl.h> } [/cpp] Of course, this only applies if you're using C++ to begin with. edit: Note that GLUT is not necessary; you can use other libraries like SFML (or CSML, SDL etc in C) for the window creation part as well, they might be easier to find pre-compiled 64 bit Windows binaries for.[/QUOTE] What I don't get is how you're supposed to use the new shit since Windows comes with some really old header.
[QUOTE=Xera;21025252]What I don't get is how you're supposed to use the new shit since Windows comes with some really old header.[/QUOTE] You need to manually get function pointers to the extensions. Or just use something like glew
[QUOTE=BMCHa;21024344]Try using IE.[/QUOTE] Thanks. [code] extern "C" { #include <gl/gl.h> } main() { }[/code] gives an error: error C2059: syntax error : 'string'
[QUOTE=Nikita;21026124][code] extern "C" { #include <gl/gl.h> } main() { }[/code][/QUOTE] what
All I'm doing is checking if it can include the header.
[url]http://freeglut.sourceforge.net/[/url] With this you can compile all the openGL stuff you can handle, can be compiled several different programs. I think the simplest is VS, but that is just me.
[QUOTE=Nikita;21026124]Thanks. [code] extern "C" { #include <gl/gl.h> } main() { }[/code] gives an error: error C2059: syntax error : 'string'[/QUOTE] [code]#include <gl/gl.h> int main(void) { return 0; }[/code]
[code] #include <gl/gl.h> int main() { } [/code]
[cpp] #define __THE_MAIN_FUNCION main #include "gl/gl.h" int __THE_MAIN_FUNCTION(){ system("PAUSE"); }[/cpp]
:frown: thanks for the correction
You guys aren't really returning anything, so that's not valid. I don't think.
return 0 is implied
[QUOTE=CPPNOOB;21030897]You guys aren't really returning anything, so that's not valid. I don't think.[/QUOTE] C++ for dummies is outdated. get a new book
[QUOTE=turb_;21030923]return 0 is implied[/QUOTE] Oh okay, my bad. I didn't think compilers implied stuff. Shit, semicolons after closing brackets and now this? I need to read up about this crap.
[QUOTE=CPPNOOB;21031737]I didn't think compilers implied stuff.[/QUOTE] The main function is a special case. [QUOTE=CPPNOOB;21031737]Shit, semicolons after closing brackets and now this?[/QUOTE] A semicolon after a closing bracket is only necessary after a struct or class declaration because of a (legacy, I'd say) way of declaring globals of the declared type. If you're reading an old book on C++, I'd say it might be better to just use the Internet as your learning resource. Not so much because of the minor syntax differences, but because of the coding style you'll be learning instead of what's considered good practice today, and the features you might be missing out on. [QUOTE=nullsquared;21025266] Or just use something like glew[/QUOTE] For reasons I can't recall, I couldn't get GLEW to work on Windows. GLee on the other hand worked right away. I can't remember why I gave up on GLEW though, it was probably my fault.
I was reffering to a case where a guy's program compiled fine when using semicolons after closing brackets for if statements and whatnot.
[QUOTE=CPPNOOB;21052318]I was reffering to a case where a guy's program compiled fine when using semicolons after closing brackets for if statements and whatnot.[/QUOTE] That's because empty statements are allowed. [cpp] int main() { do_stuff(123);; /* one empty statement */ ;;; /* three empty statements */ if(2 == 3) { puts("No way!"); }; /* one empty statement */ return 0; }[/cpp]
Sorry, you need to Log In to post a reply to this thread.