VS 2010 c++ Express 无法链接 recv() 和 send()
VS 2010 c++ Express cannot link recv() and send()
我正在运行64位Win 7并使用VS 2010 c ++ Express。我正在尝试学习如何构建可以连接到网站的 win32 应用程序。
当我构建应用程序时,我收到以下链接错误消息:
1> Generating Code...
1>PWP.obj : error LNK2019: unresolved external symbol
__imp__recv@16 referenced in function "int __cdecl PWP(struct HWND__ *,char *)" (?PrintWebPage@@YAHPAUHWND__@@PAD@Z)
1>PWP.obj : error LNK2019: .. __imp__send@16 referenced in function "int __cdecl PrintWebPage(struct HWND__ *,char *)" (?PrintWebPage@@YAHPAUHWND__@@PAD@Z)
1>PWP.obj : error LNK2019: .. __imp__closesocket@4 referenced in function "int __cdecl PrintWebPage(struct HWND__ *,char *)" (?PrintWebPage@@YAHPAUHWND__@@PAD@Z)
1>PWP.obj : error LNK2019: .. __imp__connect@12 referenced in function "int __cdecl PrintWebPage(struct HWND__ *,char *)" (?PrintWebPage@@YAHPAUHWND__@@PAD@Z)
1>PWP.obj : error LNK2019: .. __imp__htons@4 referenced in function "int __cdecl PrintWebPage(struct HWND__ *,char *)" (?PrintWebPage@@YAHPAUHWND__@@PAD@Z)
1>PWP.obj : error LNK2019: .. __imp__inet_addr@4 referenced in function "int __cdecl PrintWebPage(struct HWND__ *,char *)" (?PrintWebPage@@YAHPAUHWND__@@PAD@Z)
1>PWP.obj : error LNK2019: .. __imp__WSACleanup@0 referenced in function "int __cdecl PrintWebPage(struct HWND__ *,char *)" (?PrintWebPage@@YAHPAUHWND__@@PAD@Z)
1>PWP.obj : error LNK2019: .. __imp__WSAGetLastError@0 referenced in function "int __cdecl PrintWebPage(struct HWND__ *,char *)" (?PrintWebPage@@YAHPAUHWND__@@PAD@Z)
1>PWP.obj : error LNK2019: .. __imp__socket@12 referenced in function "int __cdecl PrintWebPage(struct HWND__ *,char *)" (?PrintWebPage@@YAHPAUHWND__@@PAD@Z)
1>PWP.obj : error LNK2019: .. __imp__WSAStartup@8 referenced in function "int __cdecl PrintWebPage(struct HWND__ *,char *)" (?PrintWebPage@@YAHPAUHWND__@@PAD@Z)
1>PWP.obj : error LNK2019: .. __imp__WSASetLastError@4 referenced in function _WspiapiGetAddrInfo@16
1>PWP.obj : error LNK2019: .. __imp__inet_ntoa@4 referenced in function _WspiapiLegacyGetAddrInfo@16
1>PWP.obj : error LNK2019: .. __imp__htonl@4 referenced in function _WspiapiLegacyGetAddrInfo@16
1>PWP.obj : error LNK2019: .. __imp__getservbyname@8 referenced in function _WspiapiLegacyGetAddrInfo@16
1>PWP.obj : error LNK2019: .. __imp__gethostbyname@4 referenced in function _WspiapiQueryDNS@24
1>PWP.obj : error LNK2019: .. __imp__gethostbyaddr@12 referenced in function _WspiapiLegacyGetNameInfo@28
1>PWP.obj : error LNK2019: .. __imp__getservbyport@8 referenced in function _WspiapiLegacyGetNameInfo@28
1>PWP.obj : error LNK2019: .. __imp__ntohs@4 referenced in function _WspiapiLegacyGetNameInfo@28
1>C:UsersRobertDocumentsRobApps4winWebsiteCommDebugWebsiteComm.exe : fatal
VS 2010 c++ Express 是否支持这些功能?
如果是这样,如何让我的项目找到并链接到它们?
我认为这些是本论坛的适当问题。
如果没有,我道歉。
您必须
在项目中链接wsock32.lib
。
相关文章:
- 通过套接字[TCP]传输数据 如何在C / C ++中打包多个整数并使用send() recv()传输数据
- Linux 服务器中的 Recv 缓冲区大小
- 在 for 循环中处理复杂的发送 recv 消息
- 在UNIX中通过recv/send交换数据时,如何正确使用缓冲区
- Epoll zero recv() and negative(EAGAIN) send()
- send() 或 recv() 未同步
- 如果send()返回x字节,则recv()在一个呼叫中获取相同数量的字节
- VS 2010 c++ Express 无法链接 recv() 和 send()
- send()和recv()套接字参数
- C++ Winsock struct send/recv
- Recv-Q+Send-Q>写字节
- 不能很好地与send()和recv()一起使用,短字符串的第一个字节丢失了.c++
- 线程由函数 send() 或 ACE_SOCK_Stream的 recv() 停止
- recv()/send()(在Socket中)或read()/write(在CFile中)中出错
- 将recv()和send()的缓冲区从C#传递到C++
- 以某种方式在ZMQ中同时使用Send/Recv是可能的(通过多线程)
- C/pp套接字,recv()/send()只在gdb下工作
- WinSock2:使用recv和send在单独的线程中处理接受的传入连接
- Send() and recv() double or int
- 使用Winsock的send()/recv()时是否需要确认响应