Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » Linker error (Mingw)
Linker error (Mingw) [message #10877] |
Thu, 02 August 2007 08:01 |
zaurus
Messages: 42 Registered: May 2006
|
Member |
|
|
I'm trying to use some windows function to get the MAC address of the network card. But I always get an error during linking. The function GetAdaptersInfo is defined in iphlpapi.h. I also can find a libiphlpapi.a in C:\upp\mingw\lib.
This is the source.
#include <winsock2.h>
#include <iphlpapi.h>
#include <assert.h>
#include "stdio.h"
int main(int argc, const char *argv[])
{
IP_ADAPTER_INFO AdapterInfo[2];
DWORD dwBufLen = sizeof(AdapterInfo);
DWORD dwStatus = GetAdaptersInfo(AdapterInfo, &dwBufLen);
assert(dwStatus == ERROR_SUCCESS);
PIP_ADAPTER_INFO pAdapterInfo = AdapterInfo;
return 0;
}
And this the error.
Linking...
(option '-O 2' ignored)
___main: duplicate
-> used: libmingw32.a:gccmain.o:1
-> discarded: libgcc.a:__main.o:1
1 undefined symbol(s):
_GetAdaptersInfo@8 (referenced from c:\upp\out\macadr\mingw.debug_full.main\macadr.o:1; _main; .text)
linking aborted due to fatal errors
collect2: ld returned 1 exit status
Did I miss out something or is this an issue of mingw? Anybody had a similar problem and found the solution?
Thanks for any help.
|
|
|
Goto Forum:
Current Time: Mon May 06 04:15:44 CEST 2024
Total time taken to generate the page: 0.02100 seconds
|