Search code examples
dbuild-error

Cannot Build/Run VisualD Console Example


I installed Visual D a few minutes ago(I wanted to give the language a test drive) and, using the built-in console example, tried to build and run it. Here is the code that Visual Studio generated for me:

import std.stdio;

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

And here is the build error that I recieved:

------ 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 ==========

Oh, and here is what the "Details saved as" printed out:

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\8.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!

When I build the app I get a message box that says:

enter image description here

Anyone know what I could have done wrong?


Solution

  • Writing my comment as an answer since it seems to have solved the problem: the old install of the compiler and library had to be removed and a fresh, new version put on top of it.

    What happened is the old range.d got replaced with a new range/ folder in a recent version of the library, but installing the new version kept the old file in place. So the compiler got confused: is it supposed to use the folder or the file? The unsinstall+reinstall cleaned up, removing the old file, leaving only the new.