FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

WinXP: object.d: module object cannot read file 'object.d'

 
Post new topic   Reply to topic     Forum Index -> Tutorials
View previous topic :: View next topic  
Author Message
alex_d



Joined: 01 Nov 2006
Posts: 16

PostPosted: Wed Nov 01, 2006 9:13 pm    Post subject: WinXP: object.d: module object cannot read file 'object.d' Reply with quote

Hi everyone

I followed the instructions of installing DMD, when I try to compile a file I get this error: object.d: module object cannot read file 'object.d' on WinXP.

I found the solution for Linux by googling but I did not find anything about Windows. Please help me.
Back to top
View user's profile Send private message
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Wed Nov 01, 2006 11:25 pm    Post subject: Reply with quote

Can you tell us the exact location and steps you used to install DMD ?
Back to top
View user's profile Send private message AIM Address
Bradley Smith



Joined: 20 Jun 2006
Posts: 60

PostPosted: Wed Nov 01, 2006 11:28 pm    Post subject: Reply with quote

Personally, I use the following procedure.

  1. Extract dmc.zip to C:\
  2. Extract dmd.172.zip to C:\
  3. Add c:\dm\bin;c:\dmd\bin to PATH
  4. Edit c:\dmd\bin\sc.ini to contain the following:
    LIB="?@P?\..\lib";"?@P?\..\..\dm\lib"
  5. Edit c:\dm\bin\sc.ini to contain the following:
    LIB="?@P?\..\lib";"?@P?\..\..\dmd\lib";"?@P?\..\mfc\lib";?LIB?
Back to top
View user's profile Send private message
alex_d



Joined: 01 Nov 2006
Posts: 16

PostPosted: Thu Nov 02, 2006 1:22 am    Post subject: Reply with quote

Thanks guys!

Ok, I discovered something very strange. Before I continue, I will tell the exact steps I did but first let me say this. I was totally shocked with this one.

Check this out from command prompt:

C:\>C:\dmd\bin\dmd.exe C:\dtest.d
C:\dmd\bin\..\..\dm\bin\link.exe dtest,,,user32+kernel32/noi;

Compiled successfully! BUT Check this out:

C:\>cd C:\dmd\bin

C:\dmd\bin>dmd.exe C:\dtest.d
object.d: module object cannot read file 'object.d'


Looks like when I run dmd.exe from within its path from where it is installed, I get the error but when I run it from an external location, there is no error! How can this be??

This is what I did to install DMD.

I downloaded dmd.zip from http://ftp.digitalmars.com/dmd.zip
I downloaded dmc.zip from http://ftp.digitalmars.com/dmc.zip

Then,

cd C:\
C:\>unzip dmd.zip
C:\>unzip dmc.zip

It asked me whether to overwrite some files, I said Yes.

That's all I did
Back to top
View user's profile Send private message
alex_d



Joined: 01 Nov 2006
Posts: 16

PostPosted: Thu Nov 02, 2006 2:38 am    Post subject: Reply with quote

Bradley Smith, I tried that but it didn't make any change. I just copy/pasted the string as you have written it. I will double check, may be I pasted it to the wrong section...but anyway....


When I launch dmd.exe from an an absolute location, it works. I am puzzled. I didn't know launching a program like this might make a difference and I figured it out by accident.
Back to top
View user's profile Send private message
Bradley Smith



Joined: 20 Jun 2006
Posts: 60

PostPosted: Thu Nov 02, 2006 1:59 pm    Post subject: Reply with quote

I also get the error when building in the C:\dmd\bin directory. However, it doesn't require using the absolute path, and it only occurs when in the c:\dmd\bin directory. Most of the time you won't build there anyway.

C:\>cd c:\dmd\bin

C:\dmd\bin>dmd c:\tmp.d
object.d: module object cannot read file 'object.d'

C:\dmd\bin>cd \

C:\>dmd c:\tmp.d
c:\dmd\bin\..\..\dm\bin\link.exe tmp,,,user32+kernel32/noi;

I will report this as a bug, but since it is uncommon to build in the dmd\bin directory, it probably won't get fixed for awhile.
Back to top
View user's profile Send private message
clayasaurus



Joined: 21 May 2004
Posts: 857

PostPosted: Thu Nov 02, 2006 4:30 pm    Post subject: Reply with quote

I get the same problem.

Solution: Don't build your projects in the dmd/bin directory. Wink
Back to top
View user's profile Send private message AIM Address
alex_d



Joined: 01 Nov 2006
Posts: 16

PostPosted: Fri Nov 03, 2006 4:20 am    Post subject: Reply with quote

So we have something here which is good Smile Good as in, we pin-pointed how to produce the error.
Back to top
View user's profile Send private message
Bradley Smith



Joined: 20 Jun 2006
Posts: 60

PostPosted: Sat Nov 25, 2006 12:36 pm    Post subject: Reply with quote

This problem has been fixed in DMD version 0.175.
Back to top
View user's profile Send private message
jgeewax



Joined: 19 Oct 2006
Posts: 2
Location: Philadelphia, PA, USA

PostPosted: Sun Feb 04, 2007 11:07 am    Post subject: Reply with quote

With a recent installation of Tango I'm having the 'object.d' issue. In case anyone is having a similar problem due to Tango and not the standard libphobos, the post is here:

http://www.dsource.org/projects/tango/forums/topic/17#62

JJG
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Tutorials All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group