- Joined
- Aug 7, 2010
- Messages
- 1
- Reaction score
- 0
Hi,
I am trying to use the GetAdaptersAddresses() function but I keep getting the above error. From what I understand, I have to link the iphlpapi.lib and the WS2_32.Lib which i get from the Windows SDK. However, I just fail to compile a simple program like below:
I am using Code::Blocks mingw g++ compiler.
Can anyone assist me with this??
I am trying to use the GetAdaptersAddresses() function but I keep getting the above error. From what I understand, I have to link the iphlpapi.lib and the WS2_32.Lib which i get from the Windows SDK. However, I just fail to compile a simple program like below:
Code:
#include <iostream>
#include <winsock2.h>
#include <iphlpapi.h>
#define WORKING_BUFFER_SIZE 15000
using namespace std;
int main( int argc, char** argv) {
PIP_ADAPTER_ADDRESSES pAddresses = new IP_ADAPTER_ADDRESSES[WORKING_BUFFER_SIZE];
ULONG outBufLen = WORKING_BUFFER_SIZE;
GetAdaptersAddresses( AF_UNSPEC, 0, NULL, pAddresses, &outBufLen);
return 0;
}
I am using Code::Blocks mingw g++ compiler.
Can anyone assist me with this??
Last edited: