On Wednesday, 8 May 2019 at 16:20:22 UTC, Robert M. Münch wrote:
Sometimes a simple thing should be obvious but...

// a.d
module a;

int otherFunc();

main(){
        otherFunc();
}



// myapp.d
import a;
int otherFunc(){
        return(1);
}

Those are two *entirely different* functions, `a.otherFunc` and `myapp.otherFunc`.

Generally the answer here is "don't do that". Just have module a `import myapp` and then call otherFunc.

But if you must hack around it - and seriously ask yourself if this is good design before committing to it - you can slap `extern(C)` on the `otherFunc` declaraton and definition to force them to match up in the global namespace.

Reply via email to