Back to 212 Main Page

Mobius strip

Writing C on Windows

In order to write C on any platform, you need a text editor and a C compiler. In addition, some sort of shell system and make utility are handy for larger projects. Also, using an IDE (integrated development environment) provides certain features beyond a simple text editor.

Compiler, etc

Each of these systems is free for download. However, they are all somewhat complicated to download, install, and configure. You should probably budget a couple hours for reading the help documentation and learning what needs to be done for your chosen system.

MinGW (Mingw32 - "Minalist GNU-Win32")

http://www.mingw.org/

Free, with no license problems (as per Cygwin). However, provides no POSIX layer or other 3rd party runtime DLLs.

Download: Go to the Download page. Dowload the .exe file for "MinGW". If no such package is listed under the Current distributions, look under Previous. This wizard will then download and install the other packages you need.

You can also get MSYS, which provides a simpler, less-featured Cygwin fork that provides a very simple Unix-like system for running make and other config scripts.

DJGPP

http://www.delorie.com/djgpp/

Simpler than MinGW, this port of the gcc compiler produces 32-bit Dos applications. (Dos applications still run under Windows. If you need it, there exists a RSXNTDJ add-on that allows for Win32 applications too.) This will be sufficient for the programs we're writing in this class. It also provides a basic make utility.

Download: Use the Zip Picker to figure out what zips you need to download (probably 7 to 10 files).

Cygwin

http://www.cygwin.com/

Provides UNIX utilities and libraries for Windows. Provides a POSIX layer (through a 4 meg DLL) for your programs. (This is not needed for this class, but may be handy later for networking and other projects.) Because it compiles this GPL library into your output, all products you release must be under the GPL license (you must make your source code available, etc.).

Download: There is a link to a setup.exe file from the main page. This install wizard should guide you through the rest of the installation process.

Windows Services for Unix looks to be a Windows copy of Cygwin functionality, and might be worth looking into.

Other Options

  • Contine to use uhunix through SSH.
  • Get a free copy of Visual Studio .NET through ICS's MSDNAA program.
  • Use a Mac. MacOS X comes with gcc.
  • Install some flavor of Linux, such as Ubuntu Linux, and learn to use Unix on your home machine. (All come with gcc, make, etc.)
  • Scour the Web for other options.

IDEs

Textpad

http://www.textpad.com/

TextPad is a great, customizable editor for writing code in any language. For small projects, it's all you really need. You can download a shareware version to try it. I found it well worth its $25 (then) pricetag.

Eclipse

http://www.eclipse.org/

Eclipse is great for writing Java code. But it can also a extended through various plugins to be an IDE for any language, including C/C++. Eclipse itself is written in Java, so while it takes a long time to start up, it can be used on nearly any platform.

Download: Go to the Downloads page and get the latest Eclipse SDK. You can also find the CDT C/C++ IDE plugin there too.

Configuration notes:

  • You should be able to configure Eclipse to use any of the above compilers. Make sure that your system path (which you can edit by going to Start -> Control Panel -> System, Advanced tab, Environment Variables, and editing the values for Path) includes the directories containing your compiler, debugger, make, and other utilities.
  • Managed Make Projects work quite well. If you choose to write your own makefile for Eclipse to follow, you will either need to include an all and a clean directive, or else change the preferences for what Eclipse calls when you build a project.
  • Eclipse may not be able to recognize your compiled programs as executables, so you won't be able to run them from within Eclipse. To fix this, go (in Eclipse) to Window -> Preferences, C/C++ -> Make -> New Make Projects. Under the Binary Parser tab, click the PE Windows Parser.

Other Options

Remember, you don't need a whole separate program in order to write C code. You just need a text editor that will let you save plain text. You can use notepad, wordpad, MS office, MS edit, or your other favorite editor. You may also find other IDEs, either free or for cost, that you prefer.




~ztomasze Index : TA Details : ICS212 : C on Windows
http://www2.hawaii.edu/~ztomasze
Last Edited: 30 Sept 2005
©2005 by Z. Tomaszewski.