Configuring OpenGL (GLUT) in Code Blocks
Configuring OpenGL (GLUT) in Code Blocks
Step-by-step procedure to setup OpenGL (GLUT) in CodeBlocks IDE for windows.
Install Code Blocks IDE for coding C, C++ download from (Preferred 13.12 to 17.12):
http://www.codeblocks.org/downloads/sources/5
Step – 1
- Download GLUT Library and unzip the file.
Step – 2
- Copy the glut.h file from downloaded folder and paste to the folder “C:\Program Files(x86)\CodeBlocks\MinGW\include\gl“.
- Copy glut32.lib file from downloaded folder and paste to the folder “C:\Program Files(x86)\CodeBlocks\MinGW\lib“.
- Copy glut32.dll file from downloaded folder and paste it based on your OS system as given below.
For 32 bit Windows
- Paste to the folder “C:\Windows\System32“.
For 64 bit Windows
- Paste to the folder “C:\Windows\SysWOW64“.
Step – 3
- Open Code::Blocks. You’ll see the window as shown below.
- Click on Create a new project link.
Step – 4
- Click on GLUT project, then click Go.
Step – 5
- Enter the title name of the project, and give path to save the project.
- The project file is created by default from the title name of the project.
- Click Next.
Step – 6
- For first time it may ask you to set environment variables, Only choose the path for glut.h and gult32.lib file in respective tabs.
- For GLUT location, give the path “C:\Program Files\CodeBlocks\MinGW“
- Click Next.
Click Finish.
Step – 7
- A project is created, and you will get default main.cpp file, which has default OpenGL example program.
- Include the header file – “#include<windows.h>“, otherwise you’ll get error.
- Build and Run, and you’ll see a window as shown below
Congrtualaiton you’ve successfully configured OpenGL (GLUT) in CodeBlocks.