How to use racket-raylib-2d on Windows 10

This has eluded me for a long time and I just figured it out so I'd like to share with other people.

  1. Go to Releases · raysan5/raylib · GitHub and scroll down to raylib v2.5.0
  2. Download raylib-2.5.0-Win64-mingw.zip
  3. Open Dr. Racket, Racket on the cmdline, or your favorite text editor and run this code to find out where Racket looks dynamically linked libraries
#lang racket
(require setup/dirs)
(get-lib-search-dirs)

mine are in 2 places '(#<path:C:\Users\username\AppData\Roaming\Racket\8.4\lib> #<path:C:\Program Files\Racket\lib>)
4. extract the libraylib.dll and put in one of the two locations. I put mine in C:\Program Files\Racket\lib
5. Install racket-raylib-2d with raco pkg install racket-raylib-2d
references
6. Run the example code

#lang racket
(require raylib-2d
         raylib-2d/util
         raylib-2d/colors)

(define screenWidth 800)
(define screenHeight 450)

;; Initialization
(InitWindow screenWidth screenHeight "raylib [core] example - basic window")

(SetTargetFPS 60) ; Set our game to run at 60 frames-per-second

(raylib-basic-loop
 (begin-drawing
   (ClearBackground RAYWHITE)
   (DrawText "Congrats! You created your first window!" 190 200 20 LIGHTGRAY)))

I would assume to run other c libraries the same process would apply (assuming racket bindings existed)

  1. 6.8 API for Finding Installation Directories
1 Like