Thread overview
[Issue 1080] New: Failed to link to std.windows.registry
Mar 26, 2007
d-bugmail
Mar 26, 2007
d-bugmail
Mar 26, 2007
d-bugmail
Mar 30, 2007
d-bugmail
Apr 12, 2007
d-bugmail
March 26, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1080

           Summary: Failed to link to std.windows.registry
           Product: D
           Version: 1.010
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: wstring@gmail.com


A function defined with no implementation will make a link error:

// test.d
import std.windows.registry;
void main(){
    Key k = Registry.localMachine;
}

Error 42: Symbol Undefined _D3std7windows8registry8Registry5_ctorMFZC3std7windows8registry8Registry


-- 

March 26, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1080





------- Comment #1 from wstring@gmail.com  2007-03-26 09:34 -------
Yet another test program:
// DMD 1.010

class Foo
{
    static int bar() { return 2; }
    private this();
}

void main()
{
    int a = Foo.bar;
}


-- 

March 26, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1080


fvbommel@wxs.nl changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|DMD                         |Phobos
           Keywords|                            |link-failure




------- Comment #2 from fvbommel@wxs.nl  2007-03-26 10:14 -------
(Note that both link errors are to default constructors)
This is caused by changes made to the implicitly generated ClassInfo data to
support a new feature in v1.010[1].
The new static method Object.factory needs to be able to create an object based
only on the ClassInfo (found by a lookup on the name passed). In order to be
able to call the default constructor (if any), a pointer to it is added to the
ClassInfo instance of the corresponding class.
The presence pointer requires that if the default constructor (again, if any)
is defined in one of the object files or libraries linked in.

Regarding std.windows.registry.Registry, that class seems to exist only to
provide a namespace to some static members, with the constructor declaration
without definition in order to prevent instantiation.
The quickest way to get it to compile & link again would probably be to just
make it a struct.


[1]: The changelog entry is "Added Object.factory(char[] classname) method to create class objects based on a string".


-- 

March 30, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1080





------- Comment #3 from bugzilla@digitalmars.com  2007-03-30 14:59 -------
If you declare a function, a definition has to be somewhere for it. I'll fix std.windows.registry.Registry so it does.


-- 

April 12, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1080


bugzilla@digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #4 from bugzilla@digitalmars.com  2007-04-11 22:00 -------
Fixed dmd 1.011


--