Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

GetAdaptersInfo gives link error

Avatar of plq
plqFlag for United Kingdom of Great Britain and Northern Ireland asked on
C++
4 Comments1 Solution2974 ViewsLast Modified:
Hi folks. IPHlpApi is a lib and .h file in the SDKs and I'm trying to call it from MSVC6.

I get this: unresolved external symbol "unsigned long __stdcall GetAdaptersInfo(struct _IP_ADAPTER_INFO *,unsigned long *)" (?GetAdaptersInfo@@YGKPAU_IP_ADAPTER_INFO@@PAK@Z)

I had to take out the iphldapi.h header file because it contains all sorts of MS.net compiler specific stuff which doesnt work in msvc6, so I declared it all myself...

#define __allowed(p)
#define __out_bcount_opt(size)                        __allowed(on_parameter)
#define __inout                                       __allowed(on_parameter)

ULONG
WINAPI
GetAdaptersInfo(
    __out_bcount_opt(*SizePointer)  PIP_ADAPTER_INFO AdapterInfo,
    __inout                         PULONG           SizePointer
    );

And I'm sure thats the problem, but I'm not sure how to fix it !!

I did add iphlpapi.lib to the list of linker libs, and I've ensured that the path to the lib is in the paths in tools>options.

This seems to work fine in later compilers, but I really need it to work in msvc6.

thanks
ASKER CERTIFIED SOLUTION
Avatar of jkr
Commented:
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answers