How To Install OpenGL For C++ In Codeblocks

  1. Download Freeglut files from HERE.
  2. Go to Bin and copy freeglut.dll to
    • if 32 bit OS then copy to windows/system32
    • if 64 bit OS then copy & paste to SYSWOW64
  3. Go to include and copy all files, then paste to C:\Program Files (x86)\CodeBlocks\MinGW\include\GL
  4. Go to lib ,and copy two files to C:\Program Files (x86)\CodeBlocks\MinGW\lib
  5. Open Notepad
    • Open C:\Program Files (x86)\CodeBlocks\share\CodeBlocks\templates
    • Find file glut.cbp
    • Search and Replace glut32 by freeglut
    • Save
    • Again Open C:\Program Files (x86)\CodeBlocks\share\CodeBlocks\templates\wizard\glut
    • Find wizard.script
    • Search and Replace glut32 by freeglut
    • Save
  6. Run CodeBlocks
  7. Make a new glut project, select the Glut location as C:\Program Files (x86)\CodeBlocks\MinGW
  8. Remove Code from main () and place your own code there
  9. Enjoy
Watch Video

No comments