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.
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).
Ah thanks. Then it should be fixed in the docs. Also at http://digitalmars.com/d/2.0/dll.html#com
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.
#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.
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.
If it's fixed, we shall close it. :)
It isn't fixed, std.windows.iunknown is still present.
Okie no more monkey-business from me.
Commit pushed to https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/5ad3dafd10002983fe92907c14ff5e8322c22d86 fix Issue 4295 - IID_IUnknown symbol undefined in phobos.lib