使用gethostname需要连接lib:

#include  <winsock2.h> 
#pragma comment(lib, "WS2_32.lib")

posted on 2018-05-02 13:38  Mr_Seven77  阅读(931)  评论(0编辑  收藏  举报