Cou*_*ite 6 c windows reference undefined
我正在尝试使用InetPtonW:
if(InetPtonW(AF_INET, argv[1], &ThisSenderInfo.sin_addr)<=0) {
return 1;
}
Run Code Online (Sandbox Code Playgroud)
但是在编译时我收到以下消息:
warning: implicit declaration of function 'InetPtonW' [-Wimplicit-function-declaration]
undefined reference to `InetPtonW'
collect2.exe: error: ld returned 1 exit status
Run Code Online (Sandbox Code Playgroud)
我已经阅读了这里的文档,我已经按照所有内容进行了操作,但仍然无法使用它.
•我正在gcc test.c -o test -lws2_32使用MinGW 编译Ws2_32库
•我已经包含了所需的头文件#include <ws2tcpip.h>和#include <windows.h>
•我尝试过使用InetPton但它返回相同的错误
•在Windows 10上运行