External symbol _ imp _ wsacleanup @ that cannot be parsed @

Source: Internet
Author: User

/// // Problem ///// //////////////////////////////////////// /////////////////////////

When writing C ++ socket-related programs, the following errors are encountered: (record the solution and keep a little bit of it !)

Error 2 error lnk2019: the external symbol _ imp _ wsacleanup @ 0 that cannot be parsed. This symbol is used in the function "int _ cdecl initwinsock (void )"(? Initwinsock @ yahxz) referenced in E: \ learning program \ c ++ \ naluh264 \ naluh264 \ encoder. OBJ naluh264
Error 3 error lnk2019: the external symbol _ imp _ wsastartup @ 8 that cannot be parsed. This symbol is used in the function "int _ cdecl initwinsock (void )"(? Initwinsock @ yahxz) referenced in E: \ learning program \ c ++ \ naluh264 \ naluh264 \ encoder. OBJ naluh264
Error 4 error lnk2019: the external symbol _ imp _ Send @ 16 that cannot be parsed is referenced in function _ main. E: \ learning program \ c ++ \ naluh264 \ naluh264 \ encoder. OBJ naluh264
Error 5 Error lnk2019: the external symbol _ imp _ htonl @ 4 that cannot be parsed is referenced in function _ main. E: \ learning program \ c ++ \ naluh264 \ naluh264 \ encoder. OBJ naluh264
Error 6 error lnk2019: the external symbol _ imp _ connect @ 12 that cannot be parsed. This symbol is referenced in function _ main. E: \ learning program \ c ++ \ naluh264 \ naluh264 \ encoder. OBJ naluh264
Error 7 Error lnk2019: the external symbol _ imp _ socket @ 12 that cannot be parsed is referenced in function _ main. E: \ learning program \ c ++ \ naluh264 \ naluh264 \ encoder. OBJ naluh264
Error 8 Error lnk2019: the external symbol _ imp _ inet_addr @ 4 that cannot be parsed. This symbol is referenced in function _ main. E: \ learning program \ c ++ \ naluh264 \ naluh264 \ encoder. OBJ naluh264
Error 9 error lnk2019: the external symbol _ imp _ htons @ 4 that cannot be parsed is referenced in function _ main. E: \ learning program \ c ++ \ naluh264 \ naluh264 \ encoder. OBJ naluh264

\\\\\\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

Add a reference to the header file:

#pragma comment(lib,"ws2_32.lib")

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.