-
-
Notifications
You must be signed in to change notification settings - Fork 691
Compiling standalone executables
Mauer-Oats edited this page Jul 2, 2022
·
5 revisions
Standalone executables can be created from the command line using raco or by using "Create Executable" in DrRacket.
Using raco exe produces an executable that may reference dynamically linked libraries from the system it was built in, including DLLs in the Racket distribution used to build the executable.
Using raco distribute includes all dynmically linked libraries necessary for the program to run.
The complete DrRacket-based explanation below creates a distribution, intended to run on any computer.
- Download and install Racket from https://download.racket-lang.org
- Start DrRacket
- Choose the language: The Racket language in the Language dialog. (This shows up the first time you use DrRacket)
- Paste this simple GUI app into DrRacket. (the top 'Definitions' bit - don't forget to replace the
#lang racketwith the#lang racket/guiso you don't have two#lang ...lines)
#lang racket/gui
(define my-language 'English)
(define translations
#hash([English . "Hello world"]
[French . "Bonjour le monde"]
[German . "Hallo Welt"]
[Greek . "Γειά σου, κόσμε"]
[Portuguese . "Olá mundo"]
[Spanish . "Hola mundo"]
[Thai . "สวัสดีชาวโลก"]))
(define my-hello-world
(hash-ref translations my-language
"hello world"))
(message-box "" my-hello-world)- Click the yellow floppy disk icon to save, or use 'Save Definitions' in the
Filemenu. - Click the
Create Executablein theRacketmenu. - For the type, choose
Distributionto fully package your app to run on other machines. - For base, choose
GRacket. (don't worry about the files for icons for now) - Click the
Createbutton to compile your app.
