dmd仅有头的模块,方便编译

--- electron.di ---
module electron;
pragma(root);    // 仅头库

int orbit() { return 3; }

--- atom.d ---
module atom;
import core.stdc.stdio;

import electron;

void main() {
    printf("%d orbits\n", orbit());
}

编译:

  dmd atom

就像你输入了:

  dmd atom electron

类似dmd -i.

posted @ 2021-10-22 16:18  zjh6  阅读(15)  评论(0)    收藏  举报  来源