VS 2010 c++ Express 无法链接 recv() 和 send()

VS 2010 c++ Express cannot link recv() and send()

本文关键字:recv send 链接 2010 c++ Express VS      更新时间:2023-10-16

我正在运行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