Troubleshooting Linker error (Symbol Undefined)

Andrej Mitrovic andrej.mitrovich at gmail.com
Sun Sep 30 22:04:44 PDT 2012


On 10/1/12, Jesse Phillips <jessekphillips+D at gmail.com> wrote:
> snip

1. The import lib shipped with DMD is outdated and is missing that
symbol (http://d.puremagic.com/issues/show_bug.cgi?id=6625)
2. The actual function has C linkage (STDAPI in WinAPI headers

Find oleaut32.dll in your Windows folder, and run implib on it:
$ implib oleaut32.lib oleaut32.dll /s

Put the import lib in the same folder as the project and change
linkage to extern(C). It works for me this way.

Btw, to verify linkage you can always search the function name on
google, find the MSDN page
(http://msdn.microsoft.com/en-us/library/windows/desktop/ms221006%28v=vs.85%29.aspx),
under requirement it says "Header - OleAuto.h".

Those headers are usually here (you'd need to install the Windows SDK though):
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include

In OleAuto.h VarCmp has STDAPI linkage, which is a macro to extern
"C", defined in BaseTyps.h.


More information about the Digitalmars-d-learn mailing list