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

D compiler and phobos/object.d are mismatched?

Moderators: kris

Posted: 04/03/07 14:32:19


I tried Tango 0.96b2 a little bit with dmd.1.010/win32 in the last couple of days and found something strange.

Tango works OK unless I define a class in my source code. If I do, the compiler stops at the line saying

class CClass

with the error message:

class [source file name].[class name] D compiler and phobos/object.d are mismatched

I first thought it was some kind of incompatibility of the binary distribution of tango and the current version of dmd, so I started over with a freshly installed dmd and dm and the source distribution of tango, but when I run build-dmd.bat, I get

dmd -c -release -O -inline -w genobj.d -ofgenobj.obj

genobj.d(83): class object.Object D compiler and phobos/object.d are mismatched

genobj.d(237): class object.ClassInfo? D compiler and phobos/object.d are mismatched

genobj.d(274): class object.TypeInfo? D compiler and phobos/object.d are mismatched

genobj.d(344): class object.TypeInfo?_Typedef D compiler and phobos/object.d are mismatched

genobj.d(373): class object.TypeInfo?_Enum D compiler and phobos/object.d are mismatched

genobj.d(377): class object.TypeInfo?_Pointer D compiler and phobos/object.d are mismatched

genobj.d(422): class object.TypeInfo?_Array D compiler and phobos/object.d are mismatched (...)

This obviously is no common problem. If I enter the bug message into Google, I get two matches (unfortunately both in Japanese, so I don't understand).

Has anybody any idea what's going wrong?

Best regards, Dr_Vitus

Author Message

Posted: 04/03/07 19:20:50 -- Modified: 04/03/07 19:23:51 by

I had the same problem recently. At the very least, this happens if you have DMD 1.010 installed, along with the Tango Beta 2 installer.

I reverted my DMD installation to 1.009 and re-ran the Tango installer. That seemed to do the trick.

If it helps, you can find older DMD releases on the digitalmars FTP server:

-- EricAnderton at yahoo

Posted: 04/04/07 08:42:46

Hi Pragma!

Thanks a lot for your help. I downdated to DMD 1.009 and it everything worked fine. Then I tried the current trunk version of Tango (r1991) with DMD 1.010, and it worked fine as well.

Best regards, Dr_Vitus

Posted: 04/04/07 14:33:12

I'm glad it worked - and thanks for letting me know about trunk & DMD 1.010. I know that there's been a lot of work going on in there, but I didn't know if it was stable enough for use yet.

-- EricAnderton at yahoo

Posted: 04/06/07 15:44:57

Trunk is nearly always stable enough for use, assuming you're willing to deal with occasional interface changes for classes, etc. If syncing off SVN isn't appealing, we also have daily snapshots uploaded to this page:

By the way, we're hoping to improve the snapshot process for the next Tango release (make it more obvious which compiler was used to generate binaries, etc), but if you have any suggestions, please let us know.

Posted: 04/06/07 18:25:08

The DMD compiler and runtime are intimately linked. The compiler is hard-coded to know the size of class info structs. The runtime must also correspond to this size. With the changes from 1.009 to 1.010, a "defaultConstructor" field was added to ClassInfo?. This caused any runtime to become incompatible with the compiler. Personally, I think this is a design flaw.