VS 2010 c ++ Express не может связать recv () и send ()

0

Я запускаю 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:\Users\Robert\Documents\Rob\Apps4win\WebsiteComm\Debug\WebsiteComm.exe : fatal

Поддерживает ли VS 2010 c++ Express эти функции?
Если да, то как мне получить мой проект, чтобы найти и связать с ними?

Я считаю, что это подходящие вопросы для этого форума.
Если нет, прошу прощения.

Теги:
express
visual-studio-2010

1 ответ

1
Лучший ответ

Вам нужно будет связать wsock32.lib в вашем проекте.

  • 0
    Проблема решена. Я добавил каталог lib SDK v7.1A в список каталогов lib проекта, и теперь я могу скомпилировать и связать приложение (хотя это все еще не работает - следующий шаг в моей кривой обучения). Спасибо за помощь.

Ещё вопросы

Сообщество Overcoder
Наверх
Меню