1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
|
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)
|