M
M
mIka012021-09-14 01:16:23
C++ / C#
mIka01, 2021-09-14 01:16:23

There were questions about WSAStartup can not find. What to do?

I am writing a chat on the instructions of the teacher (something like a lab.). There was a problem with WSAStartup.
Did a check and he constantly comes there. This library is missing, how to include it or fix the error?
The code:

WSADATA wsaDate; 
    WORD DLLVersion = MAKEWORD(2, 1); 

    if(WSAStartup(DLLVersion, &wsaDate) != 0); 
    {
        std::cout << "Error" << std::endl;
        exit(1);
    }


Linked Libraries:
#pragma comment(lib, "ws2_32.lib")
#include <winsock2.h> 
#include <iostream> 
#include <conio.h>


Thank you in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Ananiev, 2021-09-14
@mIka01

Well, look at the error that WSAStartup returns.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question