<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Feb 26, 2014 at 1:20 PM, Adam D. Ruppe <span dir="ltr"><<a href="mailto:destructionator@gmail.com" target="_blank">destructionator@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Try compiling your library with -defaultlib= (leaving it blank after the equal sign). Then it might work by not loading the symbols for phobos etc twice - they will only be linked into the main program.<br>
</blockquote><div><br></div><div>Thanks, but I don't see how that would help treating the D dll as a standalone library with its own GC/druntime etc. Once again, I'm doing runtime loading (via dlopen+friends) not load-time linking (via -L-lfoo compile flags).</div>
<div><br></div><div>Furthermore, the following:</div><div>dmd -oflibfoo.dylib -shared <span style="font-family:arial,sans-serif;font-size:13px">-defaultlib= </span>foo.d </div><div>results in link errors (because of '<span style="font-family:arial,sans-serif;font-size:13px">-defaultlib= ')</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">and I also tried:</span></div><div><div>dmd -offoo.o -c foo.d </div></div><div>
gcc foo.o -shared -o libfoo.dylib -Wl,-flat_namespace -Wl,-undefined -Wl,suppress</div><div><br></div><div>followed by runtime loading it in a D program (via dlopen) but not surprisingly this crashes.</div><div><br></div>
</div><br></div></div>