Click here to Skip to main content
Sign Up to vote bad
good
See more: C++
Hi. Can you help me with this code:
 
NET_API_STATUS ret  = 0 ;
    LPCWSTR servername  = L"MYSERVER";
    LPCWSTR groupname   = L"Administrators";
    LPBYTE buffer    = NULL;
    DWORD entriesRead;
    DWORD totalEntries;
    DWORD resumeHandle = 0;
    #define INFO_BUFFER_SIZE 32767
 
    ret=NetGroupGetUsers (NULL, groupname, 0, &buffer, INFO_BUFFER_SIZE, &entriesRead, &totalEntries, &resumeHandle);
 
I am getting this error:
[Linker error] undefined reference to `NetGroupGetUsers@32'
 
I am using Bloodshed Dev C++.
Posted 25 Jul '12 - 9:05


1 solution

As documentation[^] states, you should link your application with the Netapi32.lib library.
  Permalink  
Comments
Member 8738025 - 25 Jul '12 - 15:35
Can you please tell me how to do that. Where do I need to put Netapi32.lib?
Sergey Alexandrovich Kryukov - 25 Jul '12 - 19:12
Certainly, my 5, but it looks like you will need to explain C++ separate compilation and linking to OP; DLLs and DLL link libraries, too... :-) --SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 419
1 Mahesh Bailwal 373
2 Maciej Los 255
3 CPallini 175
4 Rohan Leuva 175
0 Sergey Alexandrovich Kryukov 9,287
1 OriginalGriff 7,204
2 CPallini 3,923
3 Rohan Leuva 3,211
4 Maciej Los 2,713


Advertise | Privacy | Mobile
Web01 | 2.6.130516.1 | Last Updated 25 Jul 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid