All #pragma directives are compiler specific, so the one in your example will
not work with GCC. The required bahaviur of a compiler when faced with an
unrecognised #pragma is simply to ignore it.
Microsoft's naming convention for libraries differs from GCC; so when MSDN
required XXX.lib, in GCC you use libXXX.a so the library you mentioned is
indeed the correct one.
What you need to do is #include the header and link the library. In GCC a
library in a standard path (i.e. specified on the command line by a -L
option) can be linked by adding -l<lib> to the project linker options. Note
that for a library libXXX.a, the correct option is -lXXX. The lib prefix and
.a extension are implicit. So in your case you need -liphlpap. Note also that
that is -l (lowercase-L), not teh number one or capltal-i for example.
Hi Everyone
I'm trying to use GetAdaptersAddresses function in DevC++.
From the MSDN website it seems i'm supposed to include these as the header.
include <iphlpapi.h>
pragma comment(lib, "IPHLPAPI.lib")
I have a question about IPHLPAPI.lib
I notice "libiphlpapi.a" in Dev's lib folder.
Isn't there some software that I'm supposed to use to convert this into an
.lib file for use in my program?
Thanks
Stephen
All #pragma directives are compiler specific, so the one in your example will
not work with GCC. The required bahaviur of a compiler when faced with an
unrecognised #pragma is simply to ignore it.
Microsoft's naming convention for libraries differs from GCC; so when MSDN
required XXX.lib, in GCC you use libXXX.a so the library you mentioned is
indeed the correct one.
What you need to do is #include the header and link the library. In GCC a
library in a standard path (i.e. specified on the command line by a -L
option) can be linked by adding -l<lib> to the project linker options. Note
that for a library libXXX.a, the correct option is -lXXX. The lib prefix and
.a extension are implicit. So in your case you need -liphlpap. Note also that
that is -l (lowercase-L), not teh number one or capltal-i for example.
I believe also that linking libraries is discussed in the "PLEASE READ
BEFORE POSTING A QUESTION" thread.
hi,
Isn't there some software that I'm supposed to use to convert this into an
.lib file for use in my program
regards,
phe9oxis,
http://www.guidebuddha.com