glut.h

That’s the error I got,seems like glut.h is not included but I checked and it is there.
Can’t see where is the problem

--------------------Configuration: cube - Win32 Debug--------------------
Linking…
cube.obj : error LNK2001: unresolved external symbol ___glutInitWithExit@12
cube.obj : error LNK2001: unresolved external symbol ___glutCreateWindowWithExit@8
Debug/cube.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.

cube.exe - 3 error(s), 0 warning(s)

What you’ve got there is a link error, you need to make sure you’ve linked to glut32.lib in your project settings if you’re using Visual C++.

I’ve done that but still not working and that is the problem…actually I can’t see where the problem is.
This is how it looks on my computer

File Location

gl.h
glut.h
glu.h [compiler]\include\gl

Opengl32.lib
glut32.lib
glu32.lib [compiler]\lib

Opengl32.dll
glut32.dll
glu32.dll [system]

I’m not very familiar with Glut, but those “WithExit” look kinda funny, and a google search turns up almost no results. Are you following a tutorial for this?

I am but no results… it might be something wrong with glut library??

Your glut.h may be an older version. Another problem is that you may not have ‘glut32.dll’. You can download all glut files, including glut32.lib, glut.h, and glut32.dll, “glut-3.7.6-bin.zip” at: http://www.xmission.com/~nate/glut.html

I did this but still no result,…getting a bit desperate

Did you read the readme in the zip and follow the instructions on where to extract the files. If so, when you extract the files, I found out that it makes a folder called “glut-3.7.6-bin” in the folder where you extracted them, which means it did not write over your old existing files. So you will need to go to the designated folder where you extracted the files, go in Nates folder, and copy the file to the correct folder. -Good Luck

The order is important:

#include<windows.h>// try adding this
#include<GL/gl.h>
#include<GL/glu.h>
#include<GL/glut.h>

Originally posted by Levy74:
[b]I’ve done that but still not working and that is the problem…actually I can’t see where the problem is.
This is how it looks on my computer

File Location

gl.h
glut.h
glu.h [compiler]\include\gl

Opengl32.lib
glut32.lib
glu32.lib [compiler]\lib

Opengl32.dll
glut32.dll
glu32.dll [system]

[/b]

Sounds like this could be a job for

#define GLUT_DISABLE_ATEXIT_HACK

Add that before you #include glut.h. I think that’s the right #define, anyway.