www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Symbol Undefined: _D4....__ModuleInfoZ

reply %u <wfunction hotmail.com> writes:
Hi!

I'm working on a little kernel with D, and so far, I've been able to
boot it and set up a physical memory manager.

Now, I'm trying to allow for module constructors in the code. However,
as soon as I define one, I see errors like this:

  Error 42: Symbol Undefined _D4core4stdc5stdio12__ModuleInfoZ

What does this error mean? Exactly what symbol is missing?

Thanks!
Jun 26 2011
parent reply Rainer Schuetze <r.sagitario gmx.de> writes:
On 26.06.2011 10:58, %u wrote:
 Hi!

 I'm working on a little kernel with D, and so far, I've been able to
 boot it and set up a physical memory manager.

 Now, I'm trying to allow for module constructors in the code. However,
 as soon as I define one, I see errors like this:

    Error 42: Symbol Undefined _D4core4stdc5stdio12__ModuleInfoZ

 What does this error mean? Exactly what symbol is missing?
The static module constructor causes your module to take part in the module initialization phase, so it creates a data structure that contains info about modules which are imported and should be initialized first (referenced directly or maybe indirectly, if an imported module does not have static constructors on it's own). The symbol above is the module info struct for core.stdc.stdio.
Jun 26 2011
parent %u <wfunction hotmail.com> writes:
== Quote from Rainer Schuetze (r.sagitario gmx.de)'s article
 The static module constructor causes your module to take part in
the
 module initialization phase, so it creates a data structure that
 contains info about modules which are imported and should be
initialized
 first (referenced directly or maybe indirectly, if an imported
module
 does not have static constructors on it's own).
 The symbol above is the module info struct for core.stdc.stdio.
After playing with it it turned out that it was because the imported modules weren't compiled in my project. Not sure if that's a bug or not (it doesn't make much sense to be forced to compile an external declaration...) but that was the issue.
Jun 27 2011