问题描述
嗨.我正在尝试使用此功能 [ ^ ]在我的程序中,但是我不知道如何将应用程序与Netapi32.lib和Netapi32.dll链接.
对于这个项目,我使用Bloodshed Dev C ++,但是我也有代码块和Visual Studio 2010.您能解释一下链接Netapi32.lib和Netapi32.dll时需要做什么.我需要在哪里放置它们,以及在哪里下载它们.
这是我的代码:
Hi. I am trying to use this function[^] in my program but I don''t know how to link application with the Netapi32.lib and Netapi32.dll.
For this project I am using Bloodshed Dev C++, but I have Code Blocks and Visual Studio 2010 too. Can you please explain me what I need to do to link Netapi32.lib and Netapi32.dll. Where do I need to put them, and where to download them.
This is my code:
NET_API_STATUS ret = 0 ;
LPCWSTR groupname = L"Administrators";
LPBYTE buffer = NULL;
DWORD entriesRead;
DWORD totalEntries;
DWORD resumeHandle = 0;
ret=NetGroupGetUsers (NULL, groupname, 0, &buffer, 32767, &entriesRead,&totalEntries, &resumeHandle);
我收到此错误:
[链接器错误]对NetGroupGetUsers @ 32''的未定义引用
And I am getting this error:
[Linker error] undefined reference to `NetGroupGetUsers@32''
推荐答案
#pragma comment(lib, "netapi32.lib")
这篇关于Netapi32.lib-将应用程序与库C ++链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!