正在获取lnk2019 VC++
Getting lnk2019 VC++
我收到这个错误,我不知道为什么。我想创建一个库来操作WinPcap,并公开它们的一些函数。我附上我的部分代码:
class WinPcap
{
private:
bool discoverDone;
std::list<Device> discoverDeviceList;
void Listen();
public:
WinPcap();
~WinPcap();
//This process is bloking, remain throw it in a different thread.
std::list<Device> Discover();
static void GetHostMacAddress(UINT8* macAddress, int pointerSize);
};
现在我找到了这个方法来获取c++中的主机mac地址:
void WinPcap::GetHostMacAddress(UINT8* macAddress, int pointerSize)
{
IP_ADAPTER_INFO AdapterInfo[16]; // Allocate information for up to 16 NICs
DWORD dwBufLen = sizeof(AdapterInfo); // Save memory size of buffer
DWORD dwStatus = GetAdaptersInfo( // Call GetAdapterInfo
AdapterInfo, // [out] buffer to receive data
&dwBufLen); // [in] size of receive data buffer
PIP_ADAPTER_INFO pAdapterInfo = AdapterInfo; // Contains pointer to current adapter info
}
我得到了那个函数中的错误。但是如果我评论GetAdaptersInfo函数,我就不明白了
为什么会发生这种情况?
我有点困惑,因为您的问题被标记为osx
,但GetAdaptersInfo
是Windows API调用,您似乎正在使用Visual Studio。
如果问题被错误地标记为osx
,您可能忘记将程序链接到iphlpapi.lib
如果它真的打算在OS X上工作,你可能想检查以下链接:
- 如何在linux/MacOSX中获取网络适配器统计信息
- http://wxwidgets.info/cross-platform-way-of-obtaining-mac-address-of-your-machine/
相关文章:
- 参考资源文件VC++中的$(SolutionDir)
- VC++本机单元测试,找不到调试符号
- 类C++中的函数问题(LNK2019和LNK1120错误)
- CppSQLite 抛出"LNK2019: unresolved external symbol"错误
- 在这里,当我们比较 if(vc[i]==vc1[i]) 时,它是向量数组. 实际上比较的值是多少,
- VS2015 中的 VC++ 目录
- Visual Studio中的wxwidgets应用程序给出错误"LNK2019 unresolved external symbol"
- 什么会导致LNK2019 VisualStudio中的错误?
- VS2015/VC++ 在新类模板中禁用默认 #include "stdafx.h"
- 构建 Tensorflow 调试时出现错误LNK2019
- 如何解释 #if/#else 位域?(VC++菜鸟)
- 双线程应用比单线程应用慢 C++ (VC++ 2010 Express).如何解决?
- LNK2019 在文件中调用静态成员的方法时出错.cpp
- 使用线程 C# 中的 VC++ 6.0 COM DLL
- 错误LNK2019未解析的外部符号"public: __thiscall SLinkList<char>::SLinkList<char>(void)"
- vc++JNI错误LNK2019:未解析的外部符号
- VC++库在编译应用程序时错过?解压缩.obj :错误LNK2019
- 正在获取lnk2019 VC++
- VC++Express 2008中的错误LNK2019和LNK2028
- VC++ 2010 错误 LNK2019: 未解析的外部符号