Getting MinGW and Installation
MinGW is the Minimum Gnu tools for Windows. It provides a free gcc compiler and libraries
compatibible with MS-Windows. To get and install MinGW for compiling Otk programs on MS-Windows,
carefully follow the following steps.
- Download MinGW (MinGW-3.x.x.x-x.exe) from www.mingw.org/download.shtml.
- Scroll down the page, you will see a table containing: Candidate, Current, ...
Look in the "current" section for just "MinGW". Select the binary (bin).
(It should have a name like: MinGW-3.x.x.x-x.exe)
- Select a download site. Save the file to a new directory.
- Execute it to install it. (Example: MinGW-3.1.1.0-1.exe)
Agree to license, select install drive and location carefully.
Click ok to install.
- Add MinGW\bin to your PATH environment variable.
Example:
set path=%path%;c:\MinGW\bin
This step must either be done every development-session, or else add it to your permanent set up.
To test your path setup:
echo %path%
Note: You can distribute the executables you produce to other people, without them needing to install any other files.
MinGW produces stand-alone microsoft executables. They have been tested to run on Windows'95, XP, through Windows 7 and 8.
Compiling Programs with MinGW
To compile an Otk program, for example, helloworld.c:
gcc -O helloworld.c -lglu32 -lopengl32 -lwinmm -lgdi32 -o helloworld.exe