我正在嘗試在動態鏈接的球拍中創建一個可執行文件。目前我的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