Installation and use of Code::Blocks programming environment


Copied from website Programmeren 2 by Leo Meerts, Radboud University Nijmegen.
To install the Code::Blocks programming environment for C and OpenGL on your laptop/PC:
  • MS-Windows (the order of installation is important!):
    1. Install MinGW (Minimalist GNU for Windows):
      Download the stable MinGW 20120426 version and install it in directory "C:\MinGW".
      For more information and newer versions see the MinGW website.
    2. Install the GLUT library:
      Download the freeGLUT archive in the "C:\MinGW" directory, unpack and place
      • .h files in directory "C:\mingw\include\GL",
      • "libfreeglut.a" in directory "C:\mingw\lib" and
      • "freeglut.dll" in directory
          "C:\windows\system32" for the 32 bit version of Windows,
          "C:\windows\SysWOW64" for the 64 bit version of Windows.
    3. Install Code::Blocks:
      Download Code::Blocks and install.
      Or take the last version (...setup.exe) from the Code::Blocks website (Code::Blocks->Downloads->Binaries).
      More information on this website.
    4. Run Code::Blocks:
      • First time: add libraries for graphics applications using OpenGL and GLUT via Settings->Compiler and debugger->Linkersettings:
          freeglut.dll, glu32.dll and opengl32.dll in directory "C:\Windows\System32\"
          libfreeglut.a, libglu32.a and libopengl32.a in directory "C:\MinGW\lib\"
      • First time: add search directories via Settings->Compiler and debugger->Search directories:
          "C:\MinGW", "C:\MinGW\lib", "C:\MinGW\include", "C:\MinGW\include\GL"
      • First time: add compile and link options via Settings->Compiler settings->Other options:
          -lglut -lGLU -lGL
      • Now you may create a new .c source file by selecting File->New->Empty File, or choose an existing .c source file via File->Open.
        Edit/modify the file, build and run.
        NB: You don't have to use a Code::Blocks Project, just keep it simple! :)

September 18, 2012