Making opengl work

I am working on several projects for school that are due in a few weeks. However, I have not been able to get the compiler to recognize the required libraries. I have included all the library names in the additional dependancies and put the includes library files in the proper location, I have included the .dll files in the system directory, and still there is no progress. I have tried every possible type of declaration of the namespace and header files "", <>, and so on and so fourth, and the same with the namespaces. I have used pre written programs that also declare the namespaces differently as well <GL/gl.h>, but still they do not work. In my written programs the errors read as follows:
Error 1 error C1083: Cannot open include file: 'glut/glut.h': No such file or directory
c:\users\owner\documents\computer graphics\assignment11\assignment11\assignment1.cpp

9 IntelliSense: identifier "GL_POINT" is undefined c:\users\owner\documents\computer graphics\assignment11\assignment11\assignment1.cpp

As an added twist Visual Studio 10 offers the option of opening any file or namespace, and lo and behold it is able to open these files that the compiler does not exist.
Your post contains not a single question mark. It is also long.

http://content.gpwiki.org/index.php/OpenGL:Tutorials:Windows_Setup

As for GLUT... I remember it isn't included by default in neither MSVC nor Dev-C++... but I could be wrong?
I have tried every possible type of declaration of the namespace and header files "", <>, and so on and so fourth
¿Why did you consider that an option? Learn what you've got to do and do it.

Cannot open include file: 'glut/glut.h': No such file or directory
¿does the file exists? ¿do you have permissions? ¿is the path correct?
In my case, I've got to use #include <GL/glut.h>
My apologizes catfish for not including a question and for the post being a bit too long. This problem for me has been giving me issues for weeks now and I am frustrated to no end. The post is so long because I wanted to give as much information as possible, making the lack of a question as specific as possible lol.

Ne55: I know what I have to do I was merely trying it out of frustration and desperation. But more importantly is your question about the paths. How might one go about changing these paths? I assume that the process is similar for all compilers, but if it matters I am using Visual Studio 10 Ultimate.
For gcc there are the -I flag (uppercase i )
and the environment variables CPLUS_INCLUDE_PATH and C_INCLUDE_PATH
Don't know about vs

You could also try #include "full_path_here/glut.h"
I've never saw glut/glut.h but GL/glut.h
To add include directories to VC++ go to "Project"->"NameOfProject Properties"->"Configuration Properties"->"VC++ Directories". There you can add include and library paths.

You'll also need to declare the "Additional Dependencies" under "Linker"->"Input". Your libraries for glut probably look something like "glut32.lib". I'm not sure, I recently uninstalled it. You can check in the glut install directory.

Finally, remember to provide the DLLs with the project if you don't link statically.
A functional GLUT set up I have is this, no messing around with project settings:
1
2
3
4
5
6
7
8
9
10
11
#pragma comment(lib, "opengl32.lib")
#pragma comment(lib, "glu32.lib")
#pragma comment(lib, "glut32.lib")

//STL needs to come first
#include <stdio.h>
#include <cmath>

#include <gl\glut.h>  // glut.h must come before gl.h and glu.h
#include <gl\gl.h>
#include <gl\glu.h> 


I have VS 2010, and when I type #include < I get a bunch of options, and was able to find gl\gl.h, and gl\glu.h already installed.

The site that finally explained everything to me properly:
http://www.lighthouse3d.com/tutorials/glut-tutorial/setup-basics/

The site that has all the files you need (For GLUT)
http://user.xmission.com/~nate/glut.html
Last edited on
Topic archived. No new replies allowed.