Bug 4295 – IID_IUnknown symbol undefined in phobos.lib
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2010-06-08T10:24:00Z
Last change time
2014-02-15T02:43:51Z
Keywords
link-failure, rejects-valid, spec
Assigned to
nobody
Creator
hoganmeier
Comments
Comment #0 by hoganmeier — 2010-06-08T10:24:18Z
std.c.windows.windows defines extern IID IID_IUnknown (and later uses it in ComObject)
but the linker complains that the symbol is undefined.
Replacing it with
IID IID_IUnknown = {0x00000000, 0x0000, 0x0000, [0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46]};
makes it work, but I'm not sure if this is the correct GUID.
Comment #1 by r.sagitario — 2010-06-08T11:04:02Z
You need to link against uuid.lib to resolve the symbol.
I don't think it is possible to add a pragma(lib,"uuid") upon usage, so this should be mentioned somewhere (maybe http://www.digitalmars.com/d/2.0/COM.html).
Just found out that pragma(lib, "uuid") is actually present in std.windows.iunknown!
But this one is more or less obsolete.
std.c.windows.com contains more functionality and also the ComObject class that is mentioned in the docs IIRC.
Comment #4 by bugzilla — 2010-09-27T19:53:52Z
#pragma(lib, "uuid") is already present in std.c.windows.com.
So, I need an example of code where the link is failing due to not linking against uuid.lib.
Comment #5 by r.sagitario — 2010-09-27T23:05:55Z
The pragma was added by Andrei in the meantime, so you might consider it fixed.
Please consider deprecating/removing std.windows.iunknown, because it only duplicates part of the code in std.c.windows.com which can lead to confusion.
Comment #6 by andrej.mitrovich — 2011-05-24T21:01:55Z
If it's fixed, we shall close it. :)
Comment #7 by hoganmeier — 2011-05-25T06:29:08Z
It isn't fixed, std.windows.iunknown is still present.
Comment #8 by andrej.mitrovich — 2011-05-25T07:23:16Z
Okie no more monkey-business from me.
Comment #9 by github-bugzilla — 2012-01-23T18:05:47Z