Thread overview
AA rehash link error
Aug 16, 2012
Øivind
Aug 16, 2012
David Nadlinger
Aug 16, 2012
Jonathan M Davis
August 16, 2012
I got no response in the 'learn' section, so I am reposting here. I think this must be a bug..

When building my program by compiling .o files first and then
linking, everything links fine, but when I try to compile all the
source files at once, I get the following link error:

build/debug/dboss-debug.o: In function `@property
boss.proc.proccmd.ProcCmd.Cmd[immutable(char)[]]
object.AssociativeArray!(immutable(char)[],
boss.proc.proccmd.ProcCmd.Cmd).AssociativeArray.rehash()':
/usr/include/dmd/druntime/import/object.di:465: undefined
reference to
`_D44TypeInfo_HAyaC4boss4proc7proccmd7ProcCmd3Cmd6__initZ'

The AA in question is a static class member declared as follows:

  static immutable Cmd[string] m_cmds;

And Cmd is a class defined in the same class:

  static class Cmd {
    alias string function(ProcCmd c, string[] args) fExec;

    string  m_cmd;   //Invocation name
    string  m_desc;  //Description of command
    fExec   m_exec;  //Function implementing command

    this(string cmd, string desc, fExec exec) {
      m_cmd = cmd;
      m_desc = desc;
      m_exec = exec;
    }
  }

What is happening? This is working perfectly fine when
building object files before linking.
August 16, 2012
On Thursday, 16 August 2012 at 21:57:14 UTC, Øivind wrote:
> I got no response in the 'learn' section, so I am reposting here.

This group is only meant to mirror the Bugzilla activity feed. Please post a self-contained test case at d.puremagic.com/issues/.

David
August 16, 2012
On Thursday, August 16, 2012 23:57:11 Øivind wrote:
> I got no response in the 'learn' section, so I am reposting here. I think this must be a bug..

Please don't post here. This list is really only supposed to be posted to by bugzilla. I don't know why it's even enabled for anyone else to post to it. You sign up for this list if you want to see all of the messages from bugzilla. Report bugs here:

http://d.puremagic.com/issues

And you may yet get a response in D.learn. People don't always respond quickly.

- Jonathan M Davis