To build openGL on CodeBlocks we should follow these little instractions
1. Download Glut Library .zip file
2. Copy glut.h file to drive: \CodeBlocks\MinGW\include\GL folder
3. Copy glut.lib file to drive: \CodeBlocks\MinGW\lib folder
4. Copy glut,dll file to C:\Windows\System32or C:\Windows\System32 folder
then follow these steps carefully
step 1: Open the code block you will see window as below and click on create new porject link, like this
step 2: click on GLUT project as shown in image below
click next
write project title name ,give path to save project and write projec filename will create by default from project title name.
After that click next.
step 3: now give the path “Drive:\CodeBlocks\MinGW” for glut location
Then click next.
step 4:
now you see the project is created and you will get default main.cpp file don’t forget to write “#include<windows.h>” header file otherwise you will get error now built and run it will see window as below.
your project is created you can write your own code.