# Raco exe question

**URL:** <https://racket.discourse.group/t/raco-exe-question/3212>\
**Category:** General\
**Created:** [October 9, 2024, 11:03pm UTC](https://racket.discourse.group/t/raco-exe-question/3212 "2024-10-09T23:03:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Don](https://avatars.discourse-cdn.com/v4/letter/d/ed655f/32.png) [@Don](https://racket.discourse.group/u/Don)\
**Post date:** [October 9, 2024, 11:03pm UTC](https://racket.discourse.group/t/raco-exe-question/3212/1 "2024-10-09T23:03:50Z")

</div>

I run the following 'raco exe' command with the understanding that Racket will be embedded:

(system "raco exe ++lang racket --gui ProcessorX.rkt")

When I run the resulting main.app the GUI program displays and runs as expected.

Next, I'd like to ensure that if I pass the same main.app to an identical Operating System, but without Racket installed, it would still run. To simulate this 'no Racket installed' state, I can temporarily rename the installed Racket on my test Mac from: /Applications/Racket v8.13 to: 'RRacket v8.13'

I again run the main.app but this time I get an error message that indicates the executable expects to find Racket v8.13 (not what I expect or want).

Error message:

ffi-lib: could not load foreign library

path: /Applications/Racket v8.13/lib/libpng16.16.dylib

System error: dlopen (/Applications/Racket v8.13/lib/libpng16.16.dylib)

Note that the 'raco exe ...' command did place the file where expected:

../main.app/Content/Resources/exts/ert/r1/libpng16.16.dylib

but the executable is not looking for it in this location.

Any thoughts?

Thanks.

---

<div class="post-metadata">

**Author:** ![bakgatviooldoos](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/bakgatviooldoos/32/1381_2.png) [@bakgatviooldoos](https://racket.discourse.group/u/bakgatviooldoos)\
**Post date:** [October 9, 2024, 11:13pm UTC](https://racket.discourse.group/t/raco-exe-question/3212/2 "2024-10-09T23:13:52Z")

</div>

Hi, @Don.

I think you are looking for [`distribute`](https://docs.racket-lang.org/raco/exe-dist.html). I am spoiled, and mostly use the `DrRacket` GUI for creating executables, but it should be the same.

This bundles lib-files like `DLL`s and even ensures, e.g., that files referred to by runtime paths in your code, work the way they should when you deploy.

I hope that is helpful.

---

<div class="post-metadata">

**Author:** ![benknoble](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/benknoble/32/16_2.png) [@benknoble](https://racket.discourse.group/u/benknoble)\
**Post date:** [October 10, 2024, 12:38pm UTC](https://racket.discourse.group/t/raco-exe-question/3212/3 "2024-10-10T12:38:46Z")

</div>

It may be helpful to think of `raco exe` like a dynamically-linked executable and `raco distribute` like a statically-linked executable (bundle), but I’ve never seen anyone else make that comparison and I wouldn't trust it too far. I’m sure someone will tell me just how wrong this analogy is 😉
