In the past, using REBOL/Command, this worked fine. Now, I'm trying to load/library
a .dll
that I compiled and there is no /library
refinement for load
any longer. What is the equivalent in Rebol 3? Do I have to make an 'extension
and import
it?
2 Answers
Yes, Rebol 3 does not currently contain a Rebol 2-like DLL interface, which was limited and did not offer many useful options to wrap libraries, and e.g. callbacks were very limited too. Rebol 3 solved the situation by introducing an extension mechanism, which involves a little bit of a C code.
There was also some initiative to bring in improved Rebol 2-like DLL interface in form of a Rebol 3 extension, but the project did not work out yet, although after the ReCode conference, someone was claiming, it will come.
What you could also use is Red/System: it is a Rebol-like language, but very close to C level, so rather easy to wrap things around. Kaj De Vos created some examples, which show how to write an Rebol 3 extension as Red/System DLL.
-
Are there any good guide/tutorials for using Red/System DLL Extensions? The examples on their own are not as clear as they could be... – rgchris Jul 20 '13 at 04:43
Since this was answered, some versions of Rebol3 eg. Atronix, have the foreign function library compiled in so that you can
make library! %some.dll
See https://github.com/zsx/r3/blob/atronix/make/tests/ms-drives.r for an example on windows, and https://github.com/zsx/c2r3/blob/master/demos/gtk-demos/gtk-demo.reb for a comprehensive linux example.

- 4,856
- 1
- 23
- 41