WSAStartup function is used by process to initiate use of the Winsock DLL
Questions tagged [wsastartup]
53 questions
19
votes
5 answers
C - Undefined Reference to WSAStartup@8'
I am using Code::Blocks, MinGW, and Windows. Im trying to initialize the winsock so that I can work on a project. I keep getting the error Undefined Reference to WSAStartup@8 Anyone know how to go about fixing this?
#include
#include…

Paulo
- 191
- 1
- 1
- 4
19
votes
2 answers
Is it possible to tell if WSAStartup has been called in a process?
I've started writing an ActiveX control that makes use of sockets.
Applications that use this control may or may not also use sockets.
Is it possible for my control to tell whether WSAStartup has been called?
If not, call it. A little test reveals…

hookenz
- 36,432
- 45
- 177
- 286
18
votes
1 answer
How does WSAStartup function initiates use of the Winsock DLL?
How does WSAStartup function initiates use of the Winsock DLL?
According to the documentation
The WSAStartup function must be the
first Windows Sockets function called
by an application or DLL. It allows an
application or DLL to specify the
…

Searock
- 6,278
- 11
- 62
- 98
15
votes
4 answers
git pull fails with "Either the application has not called WSAStartup, or WSAStartup failed"
I have just installed Windows 10, Visual Studio Community 2015, and Git for Windows. I also installed the latest Bitbucket and GitHub extensions.
Within Visual Studio I cloned my Bitbucket.com-hosted repository, and performed these operations…

Nicolas Raoul
- 58,567
- 58
- 222
- 373
9
votes
3 answers
What is the cost of WSAStartup and WSACleanup?
I have a c++ win32 program that uses sockets to download some data from a server.
Before using sockets on Windows, WSAStartup must be called. MSDN says: "There must be a call to WSACleanup for each successful call to WSAStartup. Only the final…
jeforum
8
votes
1 answer
Bluetooth with C++ and winsock
I'm finding it very hard to get information on Bluetooth communication in C++. Specifically I want to avoid using any third party libraries and I simply want to connect to a device already paired with my computer.
The device has already had its…

ritchie888
- 583
- 3
- 12
- 27
8
votes
1 answer
c++ project wont connect to socket with error 10093
Why can't this program connect to the socket?
I know that WSAStartup fails, but I can't figure out how to use it.
#include "StdAfx.h"
#include
#include
#include
#include
#include
#include…

Larhalt
- 81
- 1
- 1
- 2
8
votes
1 answer
MinGW + Boost: undefined reference to `WSAStartup@8'
below is what I execute
D:\Just4Fun\software\>make -f Makefile.hands stest
g++.exe -g -D_WIN32_WINNT=0x0601 -ID:\Boost\boost_1_51_0 -LD:\Boost\boost_1_51_0\stage\lib -LD:\MinGW\lib -lboost_system-mgw46-d-1_51 -lboost_filesystem-mgw46-d-1_51…

OlegG
- 975
- 3
- 10
- 30
7
votes
6 answers
Why does Windows not allow WinSock to be started while impersonating another user
Using my own program or others I can't get winsock to run when calling if the process is created with CreateProcessWithLogonW or CreateProcessAsUserW. It returns this error when I create the socket:
WSAEPROVIDERFAILEDINIT 10106
Service provider…

Christopher Tarquini
- 11,176
- 16
- 55
- 73
6
votes
3 answers
WSACleanup and atExit
Is it okay to register WSACleanup through atExit function ? We have several applications that can terminate at different points in the code so we would like to avoid putting WSACleanup everywhere throughought the code. Curently we call WSAStartup /…
user119666
6
votes
4 answers
WSAStartup link error
I am using EVC++ and I want to compile the program which uses the sockets.
I've included
#include
And I have included in project properties a path to Ws2.lib
But still get the error at link step:
error LNK2019: unresolved external…

maximus
- 4,201
- 15
- 64
- 117
6
votes
0 answers
Is it necessary to call WSACleanup before program exit
I have a Windows socket program (XP and above) that calls WSAStartup. Is it necessary to call WSACleanup before the program exits? If I don't, will there be any negative consequences? In particular is:
WSACleanup();
exit(0);
different from merely…

Neil Mitchell
- 9,090
- 1
- 27
- 85
5
votes
4 answers
Can calling WSAStartup() from several threads cause a deadlock?
I'm developing an app that has one TCP server and several UDP servers/listeners. Each server is a separate thread, same as the worker threads for established TCP connections. I'm calling WSAStartup() in each of the threads.
Sometimes, calling…

Misko Mare
- 113
- 2
- 4
4
votes
3 answers
Winsock error code 10014
string SendRequestToServer(std::string url)
{
struct sockaddr_in addr = { 0 };
struct hostent *host = NULL;
// If the URL begins with http://, remove it.
if(url.find("http://") == 0)
url.erase(0, 7);
// Get the host name.
string hst =…

Clark Gaebel
- 17,280
- 20
- 66
- 93
4
votes
2 answers
Is the .NET use of WSAStartup safe for 64-bit apps?
There is a mismatch between the .NET Framework version and the native Win32 version of the WSAData struct, for 64-bit apps, because the order of the fields is different. I had copied the .NET version for use in our C#-based product and a coworker is…

Ron
- 1,888
- 20
- 25