undefined reference to `GetAdaptersInfo@8' but IPHlpApi.Lib is included

Hi,

I'm trying to compile a program that uses GetAdaptersInfo().
So I added IPHlpApi.Lib to my devcpp project.

The compilation command looks like this:
make.exe -f "Makefile.win" all
g++.exe main.o lan.o nic.o socket.o icmp.o  -o "beta.exe" -L"C:/Dev-Cpp/lib" "path/to/Microsoft Platform SDK for Windows Server 2003 R2/Lib/Ws2_32.lib" "path/to/Microsoft Platform SDK for Windows Server 2003 R2/Lib/IPHlpApi.Lib"

but i get this error messages:
nic.o(.text+0x2b):nic.cpp: undefined reference to `GetAdaptersInfo@8'
icmp.o(.text+0x7):icmp.cpp: undefined reference to `IcmpCreateFile@0'
icmp.o(.text+0x5a):icmp.cpp: undefined reference to `IcmpSendEcho@32'

I don't know why. ws2_32.lib is linked fine (I do not get an error like "[Linker error] undefined reference to `inet_addr@4'") but not IPHlpApi.lib.
The file IPHlpApi.lib exists...

Has anybody an idea?

Thanks
Manuel
ManuelSchoellingAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rajeev_devinCommented:
In VC++ this function is in library
Iphlpapi.lib

Try using this library also and see
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dgerhartCommented:
Solution indicated doesn't work.  When this library is added to the project the program won't compile.  BCB 6.0 generates a linker error that complaines about the library.

[Linker Error] 'C:\PROGRAM FILES\MICROSOFT PLATFORM SDK FOR WINDOWS XP SP2\LIB\IPHLPAPI.LIB' contains invalid OMF record, type 0x21 (possibly COFF)
0
dgerhartCommented:
I found that Borland has its own versions of some libraries which includes iphlpapi.lib.  They are loaced in C:\Program Files\Borland\CBuilder6\Lib\Psdk.

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.