dmd linker (OPTLINK) gives Error 42: Symbol Undefined when using extern

Joshua Reusch yoschi at arkandos.de
Sun Dec 25 14:46:32 PST 2011


Am 25.12.2011 23:26, schrieb Tal:
> I'm quite new to this language, could you please provide a short snippet of code
> to clarify ?

--- a.d:

import std.stdio;
import b;

void main() {
   writeln("some_var from Module b: \"", b.some_var, "\"");
}

--- b.d:

public string some_var = "Hello, world!";

//you can also use static module constructors to set your vars
static this() {
   some_var ~= " -- How are you?";
}


More information about the Digitalmars-d-learn mailing list