- Computers & Software
How to set up you CodeBlocks for openGL
How to set up your CodeBlocks for openGL
I am using CodeBlocks version 8.02 but I think the steps that I am going to teach is applicable to all newer version of CodeBlocks.
1.Files to download
2. Copy the 3 downloaded header files
- and paste to C:\Program Files\CodeBlocks\MinGW\include\GL
3. Copy the 3 downloaded library files
- and paste to C:\Program Files\CodeBlocks\MinGW\lib
4. Copy the 3 downloaded DLL files
- and paste to C:\WINDOWS\system32
5. After you have done all the above steps, it should compile, if not:
-Did you forget to include your files in your code?
- Example :
#include <cstdlib> #include <cstdio> #include <GL/glut.h>
-Did you make an empty project for your .cpp and header files?
- In CodeBlocks: File->New->Project->Empty Project->then input you desire project name and path.
- After you created your project file, on the left panel of your CodeBlocks right click your project (Go to: View->Manager) and "Add files".
- Add your .cpp and header files.
-Add linker to your project file.
- Right click project name->Build options
- Choose your project.
- Select Linker settings.
- Add your library files.