Comment #0 by stefan.sonnenberg — 2012-06-13T11:48:43Z
Given this code snippet:
8-<
import std.c.stdio;
import std.c.windows.windows;
extern (Windows) BOOL IsUserAnAdmin();
int main(string[] args) {
return IsUserAnAdmin();
}
>-8
and compiling it with
dmd test.d shell32.lib
OPTLINK (R) for Win32 Release 8.00.12
Copyright (C) Digital Mars 1989-2010 All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
test.obj(test)
Error 42: Symbol Undefined _IsUserAnAdmin@0
--- errorlevel 1
IsUserAdmin is exported by shell32.dll and so this might be a bug ?
Bug reproducable on Windows Vista 32 Bit, DMD32 D Compiler v2.059
Comment #1 by yebblies — 2012-07-03T09:57:55Z
This usually happens because the lib included with dmd is out of date. It can be worked around by generating a new import lib from the dll (using implib) or by using LoadLibrary/GetProcAddress manually.
Comment #2 by andrej.mitrovich — 2012-12-26T15:39:15Z
*** This issue has been marked as a duplicate of issue 6625 ***