- #CODE BLOCKS MINGW HOW TO#
- #CODE BLOCKS MINGW INSTALL#
- #CODE BLOCKS MINGW ZIP FILE#
- #CODE BLOCKS MINGW SOFTWARE#
Simply select ‘Build > Build’ to compile, hopefully if you followed all the steps above you should have no build errors. Now click ‘Edit > Paste’ to copy in the code from the file above. Picture 1.5 – Select both debug and release Put a tick in the tickboxes next to ‘Debug’ and ‘Release’ and then click the ‘OK’ button. Picture 1.3 – Enter ‘main.cpp’ for the file name In the wizard that opens select ‘Next’, then enter ‘main.cpp’ for the filename and click ‘Save’. In CodeBlocks select ‘File > New > File…’, in the new file window select ‘Empty File’ and click the ‘Go’ button. Select all the text and click ‘Edit > Copy’
#CODE BLOCKS MINGW ZIP FILE#
zip file and open up the main.cpp file in Notepad. This application will draw a lit sphere to a window with a black background.Įxtract the. Let’s create a simple program to check everything works.ĭownload my simple glut c++ file by clicking here and downloading ‘levelbylevel_glut_tutorial_main.zip’. You now have a project setup for OpenGL and GLUT.
Picture 1.2 – your linker settings should look like this Picture 1.1 – add ‘opengl32’ to the linkerĭo the same again, this time entering ‘glu32’. In this tab, click the ‘Add’ button below the ‘Link libraries:’ text box and in the textbox next to ‘File:’ enter ‘opengl32’ (without the quotes) and click ‘OK’. In this options window select your project name in the tree to the left of the window ( do not select either Debug or Release) and open the ‘Linker settings’ tab. Once your project has been created, right click on the project in the Workspace explorer frame on the left of the screen and select ‘Build options…’. In this final wizard page, ensure that ‘GNU GCC Compiler’ is selected in the drop-down menu box labeled ‘Compiler:’, leave the other options with their default setting and click ‘Finish’. In the wizard that follows press ‘Next’ to the first page (the one welcoming you to the wizard) and in the second page enter a project title name into the textbox labelled ‘Project title:’ and leave the other 3 textboxes with their default properties (you can change these if you like, it’s upto you) and click ‘Next’. Startup CodeBlocks and select ‘File > New > Project…’, in the new project window select ‘Empty project’ and click the ‘Go’ button.
#CODE BLOCKS MINGW HOW TO#
CodeBlocks has an option for creating a GLUT project when creating a new project, we won’t be using this option today though as I want to show you how to link your files:
#CODE BLOCKS MINGW SOFTWARE#
Now you have all the required software installed you can create a new OpenGL and GLUT project. If you installed CodeBlocks and MinGW to the default directory in Step 3, this folder will be ‘C:\Program Files\CodeBlocks\MinGW\lib’. If you installed CodeBlocks and MinGW to the default directory in Step 3, this folder will be ‘C:\Program Files\CodeBlocks\MinGW\include\GL’.Ĭopy libglut32.a into the ‘MinGW\lib’ folder.
#CODE BLOCKS MINGW INSTALL#
The default install options are sufficient.Įxtract the ‘Glut.zip’ file you downloaded in Step 2 and do the following:-Ĭopy glut.dll into your ‘C:\Windows\System32’ folder (If you’re using Windows 7 64-bit, you’ll need to copy this file into ‘C:\Windows\sysWOW64’).Ĭopy glut.h into the ‘include\GL’ folder in the MinGW compiler folder. Install CodeBlocks and MinGW by running the ‘.exe’ file you downloaded in Step 1. As of writing this tutorial the file you need is: ‘’ (found by clicking on ‘Downloads’ > ‘Download the binary release’).ĭownload the GLUT file’s you’ll need by clicking here and downloading ‘glut.zip’ Be sure to select the binary installer (.exe file) which comes with the MinGW compiler. Download CodeBlocks and MinGW from the CodeBlocks website.