Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Directory problem under Windows XP, D newbie

Moderators: larsivi kris

Posted: 09/12/07 13:09:31

What is the directory structure you are assumed to use with D and Tango? The tutorials I have found have been contradictory or vague. I'm trying to build Tango from the Windows sources. I have tried the binaries to no avail. Btw, is there any way to get more verbose error info from DMD.EXE than just -v ? I would really like to see where it is looking for import modules when it says it can't find them. Then maybe I would understand what's going wrong.

My directory structure is C:\DM and C:\DMD, I unzipped Tango into C:\DMD\IMPORT.

I've set up sc.ini as follows: C:\dmd\bin>type sc.ini [Version] version=7.51 Build 020

[Environment] LIB="c:\dmd\import\lib;%@P%\..\lib" DFLAGS="-Ic:\dmd\import -Ic:\dmd\import\tango" -version=Tango -L+tango.lib LINKCMD=c:\dmd\bin\link.exe

(hardcoded just in case)

My path is PATH=C:\DMD\BIN;C:\DM\BIN

I follow the (would be nice with a link from the Tango front page btw), and run build-dmd.bat. It fails but I don't know why. If I redirect the output to a file I can see that an Errorlevel 1 is followed when processing compiler\dmd\win32.mak. I also get console messages saying

Cannot find C:\dmd\import\lib\compiler\dmd\aaA.obj. Cannot find C:\dmd\import\lib\compiler\dmd\util\console.obj. Cannot find C:\dmd\import\lib\compiler\dmd\typeinfo\ti_AC.obj Cannot find C:\dmd\import\lib\common\tango\*.di. Cannot find C:\dmd\import\lib\common\tango\core\BitManip?.obj. Cannot find C:\dmd\import\lib\common\tango\stdc\wrap.obj. Cannot find C:\dmd\import\lib\common\tango\*.di. Cannot find C:\dmd\import\lib\common\tango\core\BitManip?.obj. Cannot find hitta C:\dmd\import\lib\common\tango\stdc\wrap.obj.

Therefor I tried building the .obj files manually one by one with dmd -c. When I did this I had to change alot of import statements because dmd would say that it couldn't find util/string.d and similar when the .d file contained "import util.string;". The ti_Ireal.d couldn't find typeinfo/ti_real.d and so on. I changed all the import statements to not include the directory names, in some cases copying the file referred to when it was not in the same directory as the other files. I don't understand how this was supposed to work, do you people set up some special PATH variable or something? Because it seemes to me that it was really bugs, because only some of the files would contain directory names in the import statements.

Anyway, build-dmd can't make the obj-files and I can't pinpoint when it fails as DOS won't let me log all the outputted text (or does it? I can't remember if one can redirect stderr). It refuses to compile ti_acdouble.d saying that module ti_cdouble can't find ti_cdouble.d (?!).

I'm really lost. It can't be this hard to build Tango on Windows...

Also I must say that I think the general lack of comments in batch files and even .d files is probably keeping alot of people away from D. It is simply very frustrating trying to get started. I would have given up a long time ago if I was only trying to check out the language.

Author Message

Posted: 09/12/07 13:21:43

Btw, says:

Windows specific:

  • There is no way to build a complete Tango library with the current DMD, so a dependency aware tool with access to the Tango include directory needs to be used.

A very confusing statement!

Posted: 09/12/07 16:43:06 -- Modified: 09/12/07 16:44:32 by
kris -- Modified 2 Times

1) I suggest you quit trying to build the libs yourself until the basic stuff is working?
2) looks like your -I path is perhaps wrong? If your dir structure is c:\dmd\import\tango\io etc, then -I should be set to c:\dmd\import 
3) place the tango libraries (phobos.lib + tango.lib) alongside the DMD libraries (usually \dmd\lib)
4) forget about sc.ini for a moment (put it back to how it was)
5) try something simple, such as "cd \dmd\import\example\conduit" followed by dmd -I\dmd\import hello.d tango.lib
6) assuming #5 compiles and links correctly, adjust your sc.ini appropriately, while testing that #5 still operates.
7) if the simple compilation fails, post the errors?