PDA

View Full Version : windows.h and lm.h doesn't seem to be working properly in my code!



nackasha
2nd August 2011, 15:35
Hello Folks,

Hello Folks,

My project is implemented in Qt 4.7, and now I want 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,

cincirin
2nd August 2011, 15:51
Are you using mingw or vc compiler ?
If mingw, maybe it don't recognize
#pragma comment directive.
Try to manually add in your project
win32: LIBS += -lnetapi32

nackasha
2nd August 2011, 16:05
Many thanks. You solved my problem :)