www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1080] New: Failed to link to std.windows.registry

reply d-bugmail puremagic.com writes:
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


-- 
Mar 26 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1080






Yet another test program:
// DMD 1.010

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

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


-- 
Mar 26 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1080


fvbommel wxs.nl changed:

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





(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".


-- 
Mar 26 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1080






If you declare a function, a definition has to be somewhere for it. I'll fix
std.windows.registry.Registry so it does.


-- 
Mar 30 2007
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1080


bugzilla digitalmars.com changed:

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





Fixed dmd 1.011


-- 
Apr 11 2007