1.
用dev-cpp编译时
错误
linker error undefined reference to `ntohs@4`
问题:
缺少库 libwsock32.a
在工程属性中,在连接器参数中加入 lib目录下的libwsock32.a
2.
在使用 pcap_findalldevs_ex函数时
需要手工加入
#include <remote-ext.h>
因为在头文件中没有加入它。
3.
使用socklen_t 和 getnameinfo 函数时,
需要手工加入
#include <ws2tcpip.h>
4.
错误
[Linker error] undefined reference to `getnameinfo@28'
需要在连接器参数中加入 lib目录下的libws2_32.a
用dev-cpp编译时
错误
linker error undefined reference to `ntohs@4`
问题:
缺少库 libwsock32.a
在工程属性中,在连接器参数中加入 lib目录下的libwsock32.a
2.
在使用 pcap_findalldevs_ex函数时
需要手工加入
#include <remote-ext.h>
因为在头文件中没有加入它。
3.
使用socklen_t 和 getnameinfo 函数时,
需要手工加入
#include <ws2tcpip.h>
4.
错误
[Linker error] undefined reference to `getnameinfo@28'
需要在连接器参数中加入 lib目录下的libws2_32.a