Linking the following two files gives me a link error:
ad:
import std.stdio; extern string test (); void main() { writeln(test()); readln(); }
bd:
string test () { return "hello"; }
I get an error:
Error 42: Symbol Undefined _D1a4testFZAya` ---errorlevel 1
What's wrong?
_________________________________________________
Edit: this is the correct way to do this:
ad:
import std.stdio; import b; void main() { writeln("some_var from Module b: \"", b.some_var, "\""); }
bd:
public string some_var = "Hello, world!";
This code was kindly provided by Joshua Reusch to the excellent D beginners forum on digitalmars.com.
source share