I am using Visual C++ .NET, and I was getting the error message:
"WinSock
test project error LNK2001: unresolved external symbol "int __stdcall
WSAStartup(unsigned short,struct WSAData *)"
(?WSAStartup@@$$J18YGHGPAUWSAData@@@Z)
"
My code is as follows:
#include <winsock2.h>
int main()
{
WSADATA wsaData;
int iResult = WSAStartup( MAKEWORD(2,2), &wsaData );
}
I went to msdn.com and didn't find it very helpful.
I was able to resolve this error by adding "ws2_32.lib", by way of
the project properties pages, accessing the "Linker" setting and adding
the library to the "Command Line" through the "Addition Options:" text
box.
Though adding the library works and I get no more errors for this
specific project. I need to be able to add to/modify the command line
text so that all future projects I do have a default access to this
library.
Above the "Additional Options:" text box there is an "All Options:"
text box which list the libraries and other included files but it only
lets you delete from it and not add.
Additional information:
Inside the "All Options:" text box is as follows:
/OUT:"E:\Documents and Settings\Juan\My Documents\Visual Studio
Projects\Test files\CreateProcess\WinSock
Para_Pass\WinSock_PP\Debug\WinSock_PP.exe" /INCREMENTAL /NOLOGO /DEBUG
/ASSEMBLYDEBUG /PDB:"E:\Documents and Settings\Juan\My Documents\Visual
Studio Projects\Test files\CreateProcess\WinSock
Para_Pass\WinSock_PP\Debug/WinSock_PP.pdb" /FIXED:No kernel32.lib
user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
I would like to permanently attach "ws2_32.lib" to this command line.
-thanks
supra - 29 Jun 2005 16:26 GMT
winsock doesn't work in vs2003 and can't used api function. the vc++.net comes with bild socket....look in NET in object browser. but i'm using vb.net
using vs2003.
regards
> I am using Visual C++ .NET, and I was getting the error message:
> "WinSock
[quoted text clipped - 46 lines]
>
> -thanks