WSAStartup 链接错误 [英] WSAStartup link error

查看:12
本文介绍了WSAStartup 链接错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 EVC++,我想编译使用套接字的程序.我已经包含了

I am using EVC++ and I want to compile the program which uses the sockets. I've included

#include <winsock2.h>

我已经在项目属性中包含了 Ws2.lib 的路径但仍然在链接步骤得到错误:

And I have included in project properties a path to Ws2.lib But still get the error at link step:

错误 LNK2019:函数中引用了未解析的外部符号 WSAStartup ...

error LNK2019: unresolved external symbol WSAStartup referenced in function ...

如何解决这个问题?

推荐答案

#pragma comment(lib,"WS2_32")毕竟 #include

这篇关于WSAStartup 链接错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆