<div class="gmail_quote">On Tue, Jul 26, 2011 at 2:02 AM, Dainius (GreatEmerald) <span dir="ltr"><<a href="mailto:pastas4@gmail.com">pastas4@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

I must be missing something incredibly obvious here, but I can't find<br>
out what it is... I'm trying to build a very simple test program for<br>
LuaD, right now it simply imports the library. But it throws a linker<br>
error for some reason. Here's the program I'm trying to compile:<br>
<br>
    import std.stdio;<br>
    import luad.all;<br>
<br>
    int main()<br>
    {<br>
        readln();<br>
        return 0;<br>
    }<br>
<br>
This is what I use to compile it:<br>
<br>
    dmd -ILuaD LuaTest.d<br>
<br>
This is the error it gives me:<br>
<br>
    LuaTest.o:(.data+0x18): undefined reference to `_D4luad3all12__ModuleInfoZ'<br>
    collect2: ld returned 1 exit status<br>
    --- errorlevel 1<br>
<br>
I got LuaD by simply performing a git clone from here:<br>
<a href="https://github.com/JakobOvrum/LuaD" target="_blank">https://github.com/JakobOvrum/LuaD</a><br>
Using Linux, DMD64 v2.053.<br>
</blockquote></div><br><div>DMD will parse files you import, but won't generate output for them unless you specify them on the command line. If you want it to generate code for luad.all (which is what the linker says is missing), you need to compile like this:</div>

<div>dmd -ILuaD LuaTest.d LuaD/luad/all.d</div><div>There are probably other files you need in LuaD, so you might try generating a lib:</div><div>dmd -ILuaD -lib -ofLuaD.lib LuaD/luad/*.d [insert other paths as appropriate]</div>

<div>Which you can then use like this:</div><div>dmd -ILuaD LuaTest.d LuaD.lib</div>