我正在尝试在动态链接的球拍中创建一个可执行文件。目前我的hello world程序编译为4MB可执行文件。那就是:如何在Racket中创建动态链接的可执行文件?
#!/usr/bin/env racket
#lang racket
(define (extract str)
(substring str 4 7))
(print (extract "the cat out of the bag"))
我使用
拉科EXE first.rkt
而生成的可执行文件是4+ MB编译它。显然,它是静态链接球拍库。
- 编辑---
这里是启动代码:
#lang racket
(require launcher/launcher)
(require racket/runtime-path)
(define-runtime-path prog-path "first.rkt")
(make-racket-launcher (list (path->string prog-path))
"first"
'())
它只需要放在一个单独的文件,并执行
racket <launch-file>.rkt
谢谢。有效!! :) – Salil 2012-03-19 22:14:09