windows下使用gethostbyname函数报错无法解析的外部符号
#include <winsock.h>
使用gethostbyname的函数的时候,会显示无法解析的外部符号.
主要问题是因为没有引用WS2_32的lib库
在include上面引用就行了
#pragma comment(lib, "WS2_32")
posted on 2017-08-25 16:06 Bright Leopold 阅读(684) 评论(0) 编辑 收藏 举报
i come from the other world,i will go back after the love,the regret,the alive and the dead are over
#include <winsock.h>
使用gethostbyname的函数的时候,会显示无法解析的外部符号.
主要问题是因为没有引用WS2_32的lib库
在include上面引用就行了
#pragma comment(lib, "WS2_32")
posted on 2017-08-25 16:06 Bright Leopold 阅读(684) 评论(0) 编辑 收藏 举报