Closed vsajip closed 4 years ago
There is no support to link with additional sources or dub packages, see #4. The repl would know how to build (or at least how to link) your project.
As a simple hack, you could ask the runtime linker to preload your shared library.
env LD_PRELOAD=$PWD/foo.so dub run drepl
This does work here, but don't ask me about the implications of preloading a D shared library, expect that it might mess up the C&D runtime initializations.
Duplicate of #4
Using this source file
foo.d
in the current directory:I can build it with
dmd
2.086.0 without problems on Ubuntu 64-bit (usingdmd -offoo.so -fPIC -shared foo.d
). However, while importing it withdrepl
seems to work, I can't do much with it. Trying to call theanswer()
function:Trying to instantiate a class:
But the symbol it can't find -
_D3foo3Foo7__ClassZ
- is definitely in thefoo.so
that I built usingdmd
:Am I using it wrong, or are these known-about problems?