Error Message "ModuleInfo class is incorrect"

Kai Nacke kai at redstar.de
Wed Dec 4 23:06:47 PST 2013


Hi Mike!

On Thursday, 5 December 2013 at 01:11:13 UTC, Mike wrote:
> I'm trying to port the D Runtime, incrementally, to the ARM 
> Cortex-M (thumb2) platform.  But after bringing object.d in, 
> I'm getting this error message:
>
> "object.d ModuleInfo class is incorrect"
>
> Looking through LDC's source code, I found the following in 
> toobj.cpp
>
> // check for patch
> else
> {
> #if DMDV2
> 	unsigned sizeof_ModuleInfo = 16 * PTRSIZE;
> #else
> 	unsigned sizeof_ModuleInfo = 14 * PTRSIZE;
> #endif
> 	if (sizeof_ModuleInfo != moduleinfo->structsize)
> 	{
> 	error("object.d ModuleInfo class is incorrect");
> 	fatal();
> 	}
> }

Are you sure you are looking at a LDC source file? 
driver/toobj.cpp does not contain this piece of code. The error 
message is produced in gen/module.cpp.

> I'm not sure if PTRSIZE is not properly defined for my 
> platform, or if I need to make changes to ModuleInfo, or some 
> other problem.
>
> Please advise.

Did you change object.d_/object.di? Is the file really read? (use 
-v) If you could post a command line then I could try to figure 
out what is happening here.

Regards,
Kai


More information about the digitalmars-d-ldc mailing list