Results 1 to 3 of 3

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

  1. #1
    Join Date
    Jul 2011
    Posts
    16
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default windows.h and lm.h doesn't seem to be working properly in my code!

    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/libr...(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,

  2. #2
    Join Date
    Feb 2011
    Location
    Romania
    Posts
    53
    Thanks
    1
    Thanked 11 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: windows.h and lm.h doesn't seem to be working properly in my code!

    Are you using mingw or vc compiler ?
    If mingw, maybe it don't recognize
    Qt Code:
    1. #pragma comment
    To copy to clipboard, switch view to plain text mode 
    directive.
    Try to manually add in your project
    Qt Code:
    1. win32: LIBS += -lnetapi32
    To copy to clipboard, switch view to plain text mode 

  3. The following user says thank you to cincirin for this useful post:

    nackasha (2nd August 2011)

  4. #3
    Join Date
    Jul 2011
    Posts
    16
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: windows.h and lm.h doesn't seem to be working properly in my code!

    Many thanks. You solved my problem

Similar Threads

  1. mapToGlobal/mapFromGlobal isn't working properly
    By janderson.daz in forum Qt Programming
    Replies: 7
    Last Post: 13th April 2011, 23:03
  2. memcpy not working properly
    By sattu in forum Qt Programming
    Replies: 3
    Last Post: 27th October 2010, 00:33
  3. Delegate doesn't paint properly
    By woodtluk in forum Qt Programming
    Replies: 4
    Last Post: 11th August 2010, 12:43
  4. ScrollZoomer not working properly..
    By Raghaw in forum Qwt
    Replies: 1
    Last Post: 30th October 2009, 07:51
  5. Replies: 1
    Last Post: 2nd June 2006, 00:54

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.