My project is implemented in Qt 4.7, and now I wa开发者_C百科nt to retrieve some windows log in information. So I am dabbling around and found this code from MSDN ( http://msdn.microsoft.com/en-us/library/aa370670(v=vs.85).aspx ).
Copying and pasting this code in Visual Studio works perfectly however using it in Qt gives the error "Undefined reference to 'NetWkstaUserGetInfo@12'" !
What surprises me, Qt does autocomplete and recognize NetWkstaUserGetInfo, and it also tells about the input parameters, but then when compiled it gives the undefined error !
Kindly asking, may you please advise me in this regard,
You need to link with netapi32.lib.
See this MSDN example and pay attention to
pragma comment(lib, "netapi32.lib")
in the code.
精彩评论