Free Programming Tools for Windows
First, Assess Your Needs
What languages do you need to write your programs in? Most
engineering faculty you'll work with here probably know FORTRAN much
better than they know C or C++. FORTRAN is good for raw
number-crunching, but is not a good idea for writing programs that
require a graphical user interface, networking, or other non-numerical
features. C is a tough language to get work done in, since it makes you
keep track of array pointers, memory management, and other low-level
details. And there are always other languages such as MATLAB, Perl, and Python.
Assuming you require C, C++, or FORTRAN, look through the following
table and determine which set of software packages best meet your
needs. In all likelihood, you will not need all five of these programs, but different users will require different programs. Whichever column contains the most "Yes" answers for your
questions is probably the best fit for your programming needs. You'll
find more detailed information about each package in the sections below.
| Dev-C++ | ConTEXT and MinGW | ConTEXT, MinGW, and make | XEmacs and MinGW |
XEmacs, MinGW, and make | |
|---|---|---|---|---|---|
| You write C code |
Yes | Yes | Yes | Yes | Yes |
| You write C++ code |
Yes | Yes | Yes | Yes | Yes |
| You write FORTRAN code |
No |
Yes (1) |
Yes (1) |
Yes |
Yes |
| You often break your code up into multiple source files |
Yes |
No |
Yes |
No |
Yes |
| You need a standard Windows user interface |
Yes |
Yes |
Yes |
No |
No |
(1) ConTEXT can edit FORTRAN programs and highlight
FORTRAN syntax in different colors, but doesn't handle automatic
indentation and some other features common to many development
environments.
Potential Tools
You'll need at least some type of text editor and a compiler that
supports your chosen language. The Notepad program that comes with
Windows is a basic text editor, but isn't particularly well-suited for
writing programs. No compilers are included with Windows at all.
- Dev-C++ is an integrated development environment (IDE) for
C and
C++ code. It's probably the easiest program to get running out of the
box, but has no support for FORTRAN at all. Dev-C++ includes its own
copies of the MinGW compilers, so there is no need to install any of
the other tools in this list.
- ConTEXT is a fairly powerful text editor that can
highlight the
syntax of various programming languages. It's easy to use and
customize. ConTEXT is just a text editor, though, and you'll need to
download and install MinGW and possibly make to get a complete
programming environment.
- XEmacs is one of a family of programs that are sometimes
described as the thermonuclear flyswatters of text editors. Among other
features, Emacs
editors generally are able to highlight syntax, automatically indent
and line-wrap program code. Emacs editors are very common on Unix
systems, so you may want to use it so you can learn one editor that you
can use on all the systems you'll work on. You'll still need to
download and install MinGW and possibly make to get a complete
programming environment.
- MinGW is a collection of freely available and freely
distributable Windows specific header files and import libraries
combined with toolsets that allow one to produce native Windows
programs that do not rely on any 3rd-party C runtime DLLs. These are
Windows-native ports of the Free Software Foundations gcc, g++, and g77
compilers that are common on Unix systems. You'll still need a program
to edit the source code, however, so look at ConTEXT, XEmacs, or some
other text editor for that task.
- make is a standard tool that controls the generation of
executables and other non-source files of a program from the program's
source code. It relies on a set of rules defined in a file named
Makefile to determine which object files make an executable, and which
source files make those object files. However, make is not a compiler
itself, it just runs a compiler on source files in a particular order
to make your final executable. You'll still need a text editor like
ConTEXT or XEmacs for editing programs, and MinGW for the actual
compiling. If you always write your programs in one source code file, you won't need make.
Downloading and Installing Tools
Dev-C++
Go to the Dev-C++ download page and click on the download link for one of their versions, either the latest release, or an older one. Save the Dev-C++ installer to your hard drive, and double-click the installer. When prompted, select a Full Installation. The remaining questions in the installation process are much less important, and the default answers should work fine. When first running Dev-C++, it will ask if you want it to scan all your C and C++ headers for prototype information, which you can do immediately, or opt to do later.
ConTEXT
Start at the ConTEXT homepage, and
click on the download link there. Download the latest version of the
ConTEXT installer to your hard drive. Double-click the installer, and select a Full Installation
when prompted. The remaining questions in the installation process are
much less important, and the default answers should work fine.
XEmacs
If you need XEmacs, start by saving a copy of the XEmacs installer. For TTU users, we have a copy available on the CAE network's FTP server. For other users, go the official XEmacs download page. Save the installer to your hard drive, and double-click the installer after it's downloaded. When prompted, select Install from the Internet, the default package directory, Native Installation for All Users, the default installation directory, and direct connection installation method. On the Select Download Site menu, off-campus users can pick any download site they want, while TTU users are encouraged to select Other URL, and enter http://ftp.cae.tntech.edu/pub/xemacs/windows/
Let the XEmacs installer install the default set of packages by just clicking the Next button. Once the installer starts downloading XEmacs components, it will be several minutes before it's done.
MinGW
The MinGW download page
has a ton of files linked on it, and it's not easy to figure out which
ones you need. The only one you need from that page is named
MinGW-X.Y.Z.exe, where X.Y.Z is a version number. As of September 2005,
the preferred version is MinGW-4.1.0.exe, but that version will change in the future. Save the installer and double-click it. When prompted, select a Full Installation, and the installer will download and install all the other components required.
make
Don't install make until after you've already installed MinGW. Download the make installer (as of September 2005, mingw32-make-3.80.0-3.exe),
save it to your hard drive, and double-click it. The make installer
should automatically detect where you've installed MinGW and install
itself accordingly.
Post-Installation Configuration
Dev-C++
Dev-C++ doesn't really require any extra configuration for you to
get started writing programs. Just launch it, and it should be pretty
straightforward if you've used any other IDE in the past.
ConTEXT
For simple programs with one source file, go through the following
steps to make it easier to compile and run programs from inside
ConTEXT. For more complex programs with multiple source files, you also
need to go through the MinGW configuration steps.
ConTEXT will let you define keybindings to particular actions so
that, for example, you can assign the F9 key to compile and link your
current program, and the F10 key to run the current program. If you
want to do this, click the Options menu in ConTEXT, and then click the Environment Options command. Select the Execute Keys tab, and click the Add button. Enter the extensions you want to define these keys for: for example, you might enter f,for for FORTRAN code, c for C code, or cpp for C++ code. Do not add the period character that normally separates the filename from the extension in a program file. Do not mix extensions from two different languages! You can always define a different set of commands for C code, C++ code, etc.

The F9, F10, F11, and F12 keys automatically show up as ready for reconfiguring. Click on the F9 entry. In the Execute box to the right, type in c:\mingw\bin\g77.exe for FORTRAN code, c:\mingw\bin\gcc.exe for C code, or c:\mingw\bin\g++.exe for C++ code. In the Parameters box, type in %n -o %F.exe

Similarly, click on the F10 entry. In the Execute box, enter c:\program files\context\conexec.exe (this is the same for any language code you compile). In the Parameters box, enter -p "%p%F.exe"

Click the Apply and OK buttons at the bottom of the
dialog, and your keybindings will be saved. Repeat the process for any
other languages you want to use in ConTEXT.
XEmacs
XEmacs won't require much extra configuration, either. But go
through the MinGW configuration steps to make it easier to compile
programs from inside XEmacs.
MinGW
You'll need to add the MinGW to the default path to make it easier
for XEmacs to use its make or compiler commands, or if you want to run
the compilers from the command line. Right-click the My Computer icon on your desktop, and select the Properties menu. Click the Advanced tab, then the Environment Variables button at the bottom of the dialog. From the System variables list, select Path and click the Edit button. Add c:\mingw\bin to the end of the path variable and click the OK buttons to get back out. If you installed MinGW somwehere other than the default directory, change c:\mingw\bin in these instructions accordingly.

make
First, go through the MinGW configuration steps if you haven't already. Then, make a copy of the file c:\mingw\bin\mingw32-make.exe and name it c:\mingw\bin\make.exe -- this way, you can more easily run 'make' from a command window or from inside XEmacs.
Finally, We're Done Installing Software
Now, we can get to actually writing, compiling, and running our own code. More instructions to follow.
