Using Chicken with Windows Free Command Line VC++ Compiler Tools:
=================================================================



First install

VC++ command line tools: 

* Install .NET framework 1.1 and .NET framework redistributable 
  Both are included in the XP automatic updates or can be found at

  http://msdn.microsoft.com/netframework/downloads/updates/default.aspx

* Install .NET framework 1.1 service pack 1 (above link)
* Install .NET Framework Version 1.1 Software Development Kit (SDK)
  (above link)
* Install Windows Server 2003 SP1 Platform SDK (only the core 
  SDK option is needed duing installation):
                              
  http://www.microsoft.com/msdownload/platformsdk/sdkupdate/

* Install Microsoft Visual C++ Toolkit 2003

  http://msdn.microsoft.com/visualc/vctoolkit2003/

Some of the tools (such as LIB.EXE and NMAKE.EXE) are there but in 
really obscure locations.  Setting the environment variables as follows 
should make them available:

set INCLUDE=C:\Program Files\Microsoft Platform SDK\Include\;C:\Program Files\Microsoft Visual C++ Toolkit 2003\include\

set LIB=C:\Program Files\Microsoft Platform SDK\Lib\;C:\Program Files\Microsoft Visual C++ Toolkit 2003\lib\

set PATH=C:\Program Files\Microsoft Platform SDK\Bin\;C:\Program Files\Microsoft Platform SDK\Bin\WinNT\;C:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\;C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322;C:\Program Files\Microsoft Platform SDK\Bin\win64\


Install CHICKEN by running vcbuild.bat in the Chicken directory:
================================================================

Environment variables: 

* Add Chicken directory to PATH, in front of other paths 
  (because there is also a CSC.exe in the microsoft tools for C#)
* Add Chicken directory to INCLUDE
* Add Chicken directory to LIB



Simple example of compilation and linking:
==========================================  

Make two files foo.scm and bar.scm:

;;; foo.scm
 
(declare (uses bar))
(write (fac 10)) (newline)

;;; bar.scm

(declare (unit bar))

(define (fac n)
  (if (zero? n)
      1
      (* n (fac (- n 1))) ) )


Simplest way:

csc foo.scm bar.scm

Separate compilation:

csc bar.scm -s             ; to compile as dynamic library bar.lib, bar.dll
csc foo.scm -lbar          ; to link with library bar.lib, or
csc foo.scm -static -lbar  ; to generate statically linked executable



(Many thanks to Andre van Tonder)
