下面是项目结构:
.
├── dub.json
├── dub.selections.json
├── dub.userprefs
├── source
│ └── app.d
└── testd2
内容app.d
import std.stdio;
import scid.matrix;
import colorize: fg, color, cwriteln, cwritefln;
void main()
{
cwriteln("This is blue.".color(fg.blue));
auto c = "red";
cwritefln("This is %s".color(c), c);
}
dub.josn的内容:
{
"name": "testd2",
"description": "A minimal D application.",
"copyright": "Copyright © 2014, kaiyin",
"authors": ["kaiyin"],
"dependencies": {
"colorize": ">=1.0.5"
}
}
生成错误:
dub build
Building colorize 1.0.5 configuration "library", build type debug.
Running dmd...
Building testd2 ~master configuration "application", build type debug.
Compiling using dmd...
source/app.d(2): Error: module matrix is in file 'scid/matrix.d' which cannot be read
import path[0] = source/
import path[1] = ../../../.dub/packages/colorize-1.0.5/source
import path[2] = /usr/local/Cellar/dmd/2.066.0/include/d2
FAIL .dub/build/application-debug-posix.osx-x86_64-dmd_2066-1DB186F012CD3E69677DBEA746FFBDE1/ testd2 executable
Error executing command build: dmd failed with exit code 1.
什么任何想法出了问题? 谢谢。