#more then 100err with "winsock2"
32 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
code: #include <iostream>
#include <windows.h>
#include <WinSock2.h>
#include <WS2tcpip.h>
#pragma comment (lib, "Ws2_32.lib")
int main(int argc, char** args)
{
WSADATA wsaData;
int iResult = WSAStartup(MAKEWORD(2, 2), &wsaData);
if (iResult != 0) {
std::cerr << "WSAStartup failed: " << iResult << std::endl;
return 1;
}
std::cout << "Hello World!\n";
WSACleanup();
return 0;
}
not my packeges
include winsock stuff before windows.h
so either include windows.h first or before #include <windows.h> write #define _WINSOCKAPI_
usually errors are the first ones
in that big text
everything after that is the issue from that error usually
i'l remember
!solved
Thank you and let us know if you have any more questions!
This thread is now set to auto-hide after an hour of inactivity
