Every time I try to compile a multi-file project the linker gives me a whole list of "Symbol undefined" errors. For example, given the extremely simple source file test.d:

module test;
import test2;
import std.stdio;

void main()
{
    writef("%d",foo);
}


And test2.d:


module test2;

int foo() {return 42;}


Then I get the following error when I run dmd test:

OPTLINK (R) for Win32  Release 8.00.2
Copyright (C) Digital Mars 1989-2009  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
test.obj(test)
 Error 42: Symbol Undefined _D5test23fooFZi
--- errorlevel 1


I've already tried cleaning up all build files and adding the current directory to the system PATH, both to no avail. This does not happen while I compile single-file programs that import from the standard library. Does anyone have an idea how to fix this?

Thanks in advance.

Reply via email to