object.d: Error: module object is in file 'object.d' which cannot be read

Jacob Carlborg doob at me.com
Sun Mar 27 11:56:23 PDT 2011


On 2011-03-27 14:55, spir wrote:
> On 03/27/2011 12:28 PM, Ishan Thilina wrote:
>> When I give "dmd untitled.d" command in my ubuntu maverick 64 bit
>> laptop I get
>> the following error.
>>
>> "
>> object.d: Error: module object is in file 'object.d' which cannot be read
>> import path[0] = /etc/../../src/phobos
>> import path[1] = /etc/../../src/druntime/import
>> "
>>
>> I tried all morning to solve this problem, tried every google result I
>> could
>> find. Checked the mail archive to solve this problem. But I still
>> couldn't get
>> rid of that error.I anybody can help me, it would be a great help.
>>
>> I followed the steps in
>> http://www.digitalmars.com/d/2.0/dmd-linux.html .I
>> first used the command "cp dmd2/linux/bin/dmd.conf /etc
>> " . Then I gave "sudo apt-get install gcc-multilib g++-multilib
>> libc6-i386
>> libc6-dev-i386" command.
>>
>> Thank you :)
>
> First, please always post the piece of code that provokes an error. If
> it's a big or complicated thing, then try to reduce it to the smallest
> and simplest bit possible. Usually, doing this will let you find the
> source of the problem ;-)
>
> Second, this kind of error is caused by wrong import path (yes, the
> error message could mention "import"). Typically, when one writes eg:
> import range;
> instead of
> import std.range;
> But your case is strange. Do you know object.d is the core of D's std
> lib, which defines about all what you absolutely need to use when
> programming in D? One does not need to import it, this is automatical.
> Also, the message says the error happens in object.d itself, which is
> very un-probable.
> I thus suspect you named one of your own modules "object.d", which
> breaks the import mechanics (for D's standard object.d and possibly for
> other stdlib/phobos modules). This may be considered as a bug.
>
> denis

The error

"object.d: Error: module object is in file 'object.d' which cannot be read"

usually happens when DMD can't find the sources or phobos.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list