win64 - win32.oaidl.VARIANT -> error LNK2019

deed via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Oct 31 08:56:52 PDT 2014


// bindings from 
https://github.com/CS-svnmirror/dsource-bindings-win32/blob/308739a417eaaba85a5d3ce7741fd43d3042efe0/oaidl.d

---
import win32.oaidl;

// The following gives linker error: error LNK2019: unresolved 
external
// symbol _D5win325oaidl7VARIANT6__initZ referenced
// in function ...
VARIANT v;
v.vt = VARENUM.VT_I4;
v.lVal = 1;

// while this works - no linker error
VARIANT v = { vt: VARENUM.VT_I4, lVal: 1 };


Defining a similar structure as VARIANT with anonymous structs 
and unions targeting linux seemed to work fine without linker 
problems. What is the idiomatic way of handling this on win64?


More information about the Digitalmars-d-learn mailing list