Windows codeblocks error undefined reference to ' wsastartup@8 ' |

Source: Internet
Author: User

Windows C++socket Programming, call WSAStartup function error: undefined reference to ' [email protected] ' |

I'm using Codeblocks MinGW.

MinGW provides a simple and convenient development environment based on the GCC program under Windows. MinGW collects a series of free Windows-used header files and library files, and integrates the GNU (http://www.gnu.org/) toolset, especially GNU program development tools such as classic GCC, g++, make, etc. MinGW is free software, which simulates the development environment of the Linux under GCC on the Windows platform, provides a good foundation for C + + cross-platform development, and provides the conditions for programmers working under Windows to familiarize themselves with C + + engineering organizations under Linux.

Cause: Missing link parameters for socket

Solution: Menu-->projrcy-->build options-->debug->linker setting-->other Linker options: Add "-lws2_32"

Tools, compile options, add-lwsock32 to the connector command line by adding the following command

Windows codeblocks error undefined reference to '[email protected]' |

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.