Building DMD from git

Jonathan M Davis jmdavisProg at gmx.com
Sat Jul 23 18:47:32 PDT 2011


On Saturday 23 July 2011 20:23:16 Nick Sabalausky wrote:
> Ok, this is probably some stupid little issue, but I'm getting "object.d:
> Error: module object is in file 'object.d' which cannot be read" when I try
> to use a DMD I build from git. Here's how I'm building it all:
> 
> -----------------------------------------
> 
> [DMC is already installed and on the PATH]
> 
> >git clone https://github.com/D-Programming-Language/dmd.git
> >git clone https://github.com/D-Programming-Language/druntime.git
> >git clone https://github.com/D-Programming-Language/phobos.git
> >mkdir dmd\bin
> >mkdir dmd\lib
> >SET PATH={current_dir}\dmd\bin;%PATH%
> 
> [edit dmd\src\win32.mak and change the stupid  "CC=\dm\bin\dmc" to "CC=dmc"]
> 
> [create a specially-adjusted dmd\bin\sc.ini]
> 
> >type dmd\bin\sc.ini
> 
> [Version]
> version=7.51 Build 020
> 
> [Environment]
> LIB="%@P%\..\lib";\dm\lib
> DFLAGS="-I%@P%\..\..\phobos" "-I%@P%\..\..\druntime\import"
> LINKCMD=%@P%\link.exe
> 
> >cd dmd\src
> >make -fwin32.mak
> >cd ..\..
> >copy dmd\src\dmd.exe dmd\bin
> >cd druntime
> >make -fwin32.mak
> >cd ..
> >copy druntime\lib\druntime.lib dmd\lib
> >cd phobos
> >make -fwin32.mak
> >cd ..
> >copy phobos\phobos.lib dmd\lib
> >type test.d
> 
> import std.stdio;
> void main()
> {
>     writeln("Hello");
> }
> 
> >dmd test.d
> 
> DMD v2.055 DEBUG
> object.d: Error: module object is in file 'object.d' which cannot be read
> import path[0] = .\..\..\phobos
> import path[1] = .\..\..\druntime\import

It can't find object_.d. It means that the path to druntime (and probably the 
path to phobos as well) is screwed up. Your dmd.conf (or sc.ini I guess, since 
you appear to be on Windows) needs to be fixed to have the correct paths.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list