Glut setup for CodeBlocks | Windows
CodeBlocks is one of my favourite IDE for C programming. And yesterday when I was just trying to set up glut I’m just getting a whole list of errors. It didn’t worked the way it used to work after setup, maybe for codeblocks version?!
And I had to spend quite some time searching google to solve these errors and make it work. This post is mainly as a reminder to myself for future use and to help others who may face the same problem as me.
OS : Windows 10 64bit
CodeBlocks : v20.03
- Glut file download
https://www.transmissionzero.co.uk/software/freeglut-devel/
Info: GLUT comes in two flavours for Windows. There’s an old and unmaintained version called GLUT and an open source alternative called freeglut.
2. Unzip the file. You will see 3 following folder bin, include, lib.
3. Now copy the “include” folder & paste it at the “ …\codeblocks\mingw \x86_64-w64-mingw32 ” folder. Since my codeblocks in c drive, so the path for that,
C:\Program Files\CodeBlocks\MinGW\x86_64-w64-mingw32
4. Copy all files from “ …\freeglut\lib\x64 ” folder (since my OS is 64bit)
Paste these files in lib folder of codeblocks
C:\Program Files\CodeBlocks\MinGW\x86_64-w64-mingw32\lib
5. Copy freeglut.dll from “ …\freeglut\bin\x64 ” folder
Paste dll file in following folder
C:\Windows
Our primary set up is done. Now we’ve to edit 2 file to complete.
Go to “ ..\CodeBlocks\share\CodeBlocks\templates ”
C:\Program Files\CodeBlocks\share\CodeBlocks\templates
Find & open file ‘ glut.cbp ’. Search ‘ glut32 ’ & replace it with ‘ freeglut ’.
Again find & open ‘ wizard.script ’ file from folder “CodeBlocks\share\CodeBlocks\templates\wizard\glut”. Search ‘ glut32 ’ & replace it with ‘ freeglut ’.
C:\Program Files\CodeBlocks\share\CodeBlocks\templates\wizard\glut
Now when create glut project give Glut location to ‘x86_64-w64-mingw32’ folder.
C:\Program Files\CodeBlocks\MinGW\x86_64-w64-mingw32
That’s It!! (。・∀・)ノ゙You’re good to go.