7/27/2009

LCC - free C compiler

For those of you that are looking for an easy to use command line C compiler that works in Windows, LCC is probably your best bet.

Download LCC , a compiler that works from the command line in any version of Windows, including Vista.

http://www.cs.virginia.edu/~lcc-win32/

There's a few things you gotta do...

download and install lcc

Set the path variable to include the lcc binary directory.

In Vista and XP, do this by right clicking on "My Computer"

Choose 'advanced settings'

Select 'environment variables'

Under system variables, select NEW

For 'Variable Name', enter PATH

For 'Variable Value', enter C:\lcc\bin (or whereever you installed to)

Now you can write your program in whatever text editor you like.

To compile, go to the command line.

lcc filename.c

This creates an object file called filename.obj

Create the exe file by typing:


lcclnk filename.obj

Which will create filename.exe

Hope this might help someone. I spent a few hours messing around with it the other night. I'm more comfortable compiling C programs from the command line, so this was a good option for me.