1

I send a Racket executable(in a distribution package) to a few friends and they get the error:"Failure: can not load the DLL". On my computer it runs without problems. It's using the rsound package.

Theodor Berza
  • 573
  • 3
  • 12

1 Answers1

2

Yes, good point. Currently, rsound is hard-coded to look in the collection path for the DLL. That won't work for programs compiled into executables. I've just updated rsound to tell it to look in "standard locations" as well for Windows and Mac.

Try this: Using the DrRacket package manager, update your copy of portaudio. When you're done, it should be at version "b9403a6dfbfb5eadf824ed91731ec141bf363677".

After this, it should be possible to pass along the executable file and run it, as long as the two required dll's are in the same directory as the executable. These two dll's are:

  • portaudio.dll
  • callbacks.dll

For windows, you'll find both of these in a subdirectory of the portaudio package. Finding these is going to be a teensy bit of a hassle on Windows; I believe these get installed in your user directory\RoamingData\\portaudio\lib\win32\x86_84\3m\ . If the target computer is a 32-bit machine, you'd substitute 'i386' for 'x86_64' in that path.

I know that Windows can make it quite hard to find the files you're looking for; let me know if you have any trouble.

Whew!

John Clements
  • 16,895
  • 3
  • 37
  • 52
  • I couldn't find RoamingData on my computer so I took the callbacks.dll and the portaudio.dll from the output-ed zip(the one that was created when making the distribution package and pasted it into the directory where the application was. They were originally in the "exts" directory. Would this work as well? – Theodor Berza Jan 27 '16 at 09:53
  • The console opens but after 3 seconds it shuts down without any sound coming out. – Theodor Berza Jan 27 '16 at 11:40
  • The program is probably halting before the sounds are complete. Does it help to add, say (sleep 30) to the end of your program? – John Clements Jan 28 '16 at 00:42
  • It already has (define ok-to-exit? #f) (pstream-queue-callback stream (lambda () (set! ok-to-exit? #t)) count) (let loop () (sleep 0.1) (unless ok-to-exit? (loop))) – Theodor Berza Jan 28 '16 at 07:38
  • what is 'count' set to? – John Clements Jan 28 '16 at 20:17
  • The full code is here: http://stackoverflow.com/questions/34968953/racket-argument-is-non-null-error. Of course improved with define instead of let and with list instead of quote. – Theodor Berza Jan 29 '16 at 10:14