GLUT (OpenGL Utility Toolkit) is a toolkit to write OpenGL programs. It makes learning OpenGL programming very easy and simple. However, it is very old and unsupported for the last 20 years or more and it does not support modern requirements. I personally do not recommend this library and I request to choose one of the alternate libraries such as GLFW, freeglut, and SDL.
If you still need to setup this library to execute old code downloaded from the internet written in GLUT then follow the steps provided below:
Download the glut library from the website http://code.google.com/p/rawvideoplayer/downloads/detail?name=glut-3.7.6-bin.zip&can=2&q= for windows.
Steps to create GLUT project in Code::block.
Step 1: Extract the downloaded zip file.
Step 2: Browse extracted files. Copy the glut.h file and paste it into the directory "C:\ProgramFiles(x86)\CodeBlocks\MinGW\include\GL". Copy glut.lib file and paste it into the directory "C:\Program Files(x86)\CodeBlocks\MinGW\lib". Also, copy the glut.dll and paste it into
the directory "C:\Windows\System32".
Step 3: Open the Code::block and click on create a new project from the Start page or go to File-> New-> Project from the menu bar.
Step 4: Click on the GLUT project as shown in image below and click Go button.
Enter the necessary details and click Next button.
Step 5: Now provide path "C:\Program Files(x86)\CodeBlocks\MinGW" for glut location and click Next button.
Click Finish button.
Step 6:
Finally, the project is created and you will get the default main.cpp file and don't forget to include "#include<windows.h>" header file otherwise you will get an error while building a project. After including windows.h library built and run it will see the window as below.
If program execution failed showing glut32.dll not found then copy glut32.dll file in the same directory
side by side with a program execution file.
Please watch the video below for a detailed explanation.
Hi, do you have tutorial on setting up GLEW/GLFW/FreeGLUT, all three including the linking in Code::Blocks? I am having hard time setting it up. I found this good tutorial: http://www.arcsynthesis.org/gltut/index.html. I am getting this error when running the program (the aforementioned tutorial has source code tutorials and I had to use premake4.exe to generate the Codeblocks .cpb (no problem here).
ReplyDeleteAnyways, error I get:
cannot find -lframework (for Release of build)
cannot find -lframeworkD (for Debug of build)
Thanks very much, your illustration really help me.
ReplyDeletei didn't found bin folder nor the glut.dll...??
ReplyDeleteit doesn't work for me btw..., something wrong with the glut header , help !
ReplyDeleteWhere is the .bin folder?
ReplyDeletewhen i try to build my project then divert to glut.h. plz help
ReplyDeleteThis comment has been removed by the author.
Deleteinclude window.h at the top of the source file or include gl.h and glu.h
DeleteThanks.
ReplyDeleteHelped a lot.:)
"cannot find -lglut32 " what does this mean??
ReplyDeleteam not able to open main.c file which is under source
ReplyDeleteD:\CG PROJECTS\car Race\car.cpp|118|error: name lookup of 'y' changed for ISO 'for' scoping [-fpermissive]|
ReplyDeleteguys i get this error for every grphics program i compile???!!! :(
I am getting error in glut.h header file.what should i do?
ReplyDeleteHow to install OpenGL in Codeblocks in Ubuntu 14.04 ?
ReplyDeleteCan we modify the shapes? Can we use this technique to create softwares like faceworx or blender?
ReplyDeleteWorks superfine thank you
ReplyDeletei am getting error
ReplyDeleteC:\Program Files (x86)\CodeBlocks\MinGW\include\GL\freeglut_std.h|639|undefined reference to `_imp____glutCreateWindowWithExit@8'|
ye saare mil ke humein chutiya bana rahe hai, gand fatti ke bhadwe madarchod
Delete