Linking the following two files gives me a link-error:

a.d:
        import std.stdio;

        extern (D) string test ();

        void main()
        {
                writeln(test());
                readln();
        }
____________________________________
b.d:
        string test () {
                return "hello";
        }
____________________________________
the error I get is:

Error 42: Symbol Undefined _D1a4testFZAya`

---errorlevel 1

What is wrong ?
  • dm... Tal
    • ... Andrej Mitrovic
    • ... Tal
      • ... Joshua Reusch
        • ... Tal
          • ... Joshua Reusch
            • ... Jakob Ovrum
            • ... dmd linker (OPTLINK) gives Error 42: Symbol Undefined when using extern
      • ... Joshua Reusch

Reply via email to