不能 Build/Run VisualD 控制台示例

Cannot Build/Run VisualD Console Example

几分钟前我安装了 Visual D(我想试用一下该语言),然后使用内置的控制台示例尝试构建并 运行 它。这是 Visual Studio 为我生成的代码:

import std.stdio;

int main(string[] argv)
{
    writeln("Hello D-World!");
    return 0;
}

这是我收到的构建错误:

------ Build started: Project: TestingDApp, Configuration: Debug Win32 ------
Building Debug\TestingDApp.exe...
C:\D\dmd2\windows\bin\..\..\src\phobos\std\range.d(287): Error: module std.range from file C:\D\dmd2\windows\bin\..\..\src\phobos\std\range.d conflicts with package name range
C:\D\dmd2\windows\bin\..\..\src\phobos\std\range.d(287): Error: module std.range from file C:\D\dmd2\windows\bin\..\..\src\phobos\std\range.d conflicts with package name range
C:\D\dmd2\windows\bin\..\..\src\phobos\std\array.d(1480): Error: undefined identifier 'iteration'
Assertion failure: 'type->ty != Tstruct || ((TypeStruct *)type)->sym == this' on line 929 in file 'struct.c'
Building Debug\TestingDApp.exe failed!
Details saved as "file://C:\Users\Krythic\Desktop\TestingRoot\TestingDApp\TestingDApp\Debug\TestingDApp.buildlog.html"
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

哦,这是 "Details saved as" 打印出来的:

Build Log  
Building Debug\TestingDApp.exe  
Command Line  
set PATH=C:\D\dmd2\windows\bin;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE;C:\Program Files (x86)\Windows Kits.1\bin;%PATH%
dmd -g -debug -X -Xf"Debug\TestingDApp.json" -deps="Debug\TestingDApp.dep" -c -of"Debug\TestingDApp.obj" main.d
if errorlevel 1 goto reportError

set LIB="C:\D\dmd2\windows\bin\..\lib"
echo. > C:\Users\Krythic\Desktop\TestingRoot\TestingDApp\TestingDApp\Debug\TestingDApp.build.lnkarg
echo "Debug\TestingDApp.obj","Debug\TestingDApp.exe_cv","Debug\TestingDApp.map",user32.lib+ >> C:\Users\Krythic\Desktop\TestingRoot\TestingDApp\TestingDApp\Debug\TestingDApp.build.lnkarg
echo kernel32.lib/NOMAP/CO/NOI/DELEXE >> C:\Users\Krythic\Desktop\TestingRoot\TestingDApp\TestingDApp\Debug\TestingDApp.build.lnkarg

"C:\Program Files (x86)\VisualD\pipedmd.exe" -deps Debug\TestingDApp.lnkdep C:\D\dmd2\windows\bin\link.exe @C:\Users\Krythic\Desktop\TestingRoot\TestingDApp\TestingDApp\Debug\TestingDApp.build.lnkarg
if errorlevel 1 goto reportError
if not exist "Debug\TestingDApp.exe_cv" (echo "Debug\TestingDApp.exe_cv" not created! && goto reportError)
echo Converting debug information...
"C:\Program Files (x86)\VisualD\cv2pdb\cv2pdb.exe" "Debug\TestingDApp.exe_cv" "Debug\TestingDApp.exe"
if errorlevel 1 goto reportError
if not exist "Debug\TestingDApp.exe" (echo "Debug\TestingDApp.exe" not created! && goto reportError)

goto noError

:reportError
echo Building Debug\TestingDApp.exe failed!

:noError
Output  
C:\D\dmd2\windows\bin\..\..\src\phobos\std\range.d(287): Error: module std.range from file C:\D\dmd2\windows\bin\..\..\src\phobos\std\range.d conflicts with package name range
C:\D\dmd2\windows\bin\..\..\src\phobos\std\range.d(287): Error: module std.range from file C:\D\dmd2\windows\bin\..\..\src\phobos\std\range.d conflicts with package name range
C:\D\dmd2\windows\bin\..\..\src\phobos\std\array.d(1480): Error: undefined identifier 'iteration'
Assertion failure: 'type->ty != Tstruct || ((TypeStruct *)type)->sym == this' on line 929 in file 'struct.c'
Building Debug\TestingDApp.exe failed!

当我构建应用程序时,我收到一个消息框,上面写着:

有人知道我做错了什么吗?

写下我的评论作为答案,因为它似乎已经解决了问题:必须删除编译器和库的旧安装,并在其之上放置一个全新的新版本。

发生的事情是旧的 range.d 在库的最新版本中被新的范围/文件夹替换,但安装新版本时旧文件保留在原位。所以编译器很困惑:它应该使用文件夹还是文件? unsinstall+reinstall清理,删除旧文件,只留下新文件。