Click here to Skip to main content
15,893,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi..
Ive just started to learn IP Helper API and i was following this tutorial which is linked below and came across an error of missing a function.

https://msdn.microsoft.com/en-us/library/aa366314(v=vs.85).aspx[^]

C++
if (GetAdaptersInfo( pAdapterInfo, &ulOutBufLen) != ERROR_SUCCESS) {
    free (pAdapterInfo);
    pAdapterInfo = (IP_ADAPTER_INFO *) malloc ( ulOutBufLen );
}


this GetAdaptersInfo function, visual studio says Error: identifier "GetAdaptersInfo" is undefined.
I have
<iphlpapi.h>
<windows.h>
<winsock2.h> header files included in my program.

Whats the wrong with this ? What header file or anything i should include to get this function work ? Ive googled and I found nothing. :(

Thanks in advance.
Posted
Comments
Jochen Arndt 5-Mar-15 10:49am    
Which header files are included?
GetAdaptersInfo is declared in Iphlpapi.h.
M­­ar­­­­k 5-Mar-15 10:50am    
iphlpapi.h
windows.h
winsock2.h
Jochen Arndt 5-Mar-15 10:59am    
Then the function declaration should be found as long as the header file is included by the source file containing your code snippet.

What is the error number?
C3861 or LNK2019?

If it is the linker error, you must add the iphlpapi.lib to your project.

1 solution

 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900