Sign in to follow this  

how to add WS2_32.LIB in .Net

This topic is 4749 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

  • Add it to the list of source files of the project

  • or Add it in the list of libraries the project links to (search through the project options to find the proper place, which eludes me right now)

  • or Add a #pragma comment(lib, "WS2_32.LIB") somewhere in your source code (preferably in some central location).

Share this post


Link to post
Share on other sites
added the pragma code but did'nt really help.

Here's what I get:
Quote:

------ Build started: Project: Project1, Configuration: Debug Win32 ------

Compiling...
partoftest1.cpp
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(109) : error C2011: 'fd_set' : 'struct' type redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(54) : see declaration of 'fd_set'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(144) : warning C4005: 'FD_SET' : macro redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(88) : see previous definition of 'FD_SET'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(153) : error C2011: 'timeval' : 'struct' type redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(97) : see declaration of 'timeval'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(209) : error C2011: 'hostent' : 'struct' type redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(153) : see declaration of 'hostent'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(222) : error C2011: 'netent' : 'struct' type redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(166) : see declaration of 'netent'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(229) : error C2011: 'servent' : 'struct' type redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(173) : see declaration of 'servent'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(241) : error C2011: 'protoent' : 'struct' type redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(185) : see declaration of 'protoent'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(397) : error C2011: 'sockaddr_in' : 'struct' type redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(321) : see declaration of 'sockaddr_in'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(407) : error C2011: 'WSAData' : 'struct' type redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(331) : see declaration of 'WSAData'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(467) : warning C4005: 'SO_DONTLINGER' : macro redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(411) : see previous definition of 'SO_DONTLINGER'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(524) : warning C4005: 'AF_IPX' : macro redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(469) : see previous definition of 'AF_IPX'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(552) : warning C4005: 'AF_MAX' : macro redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(488) : see previous definition of 'AF_MAX'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(558) : error C2011: 'sockaddr' : 'struct' type redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(494) : see declaration of 'sockaddr'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(598) : error C2011: 'sockproto' : 'struct' type redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(503) : see declaration of 'sockproto'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(637) : error C2011: 'linger' : 'struct' type redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(540) : see declaration of 'linger'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(650) : warning C4005: 'SOMAXCONN' : macro redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(553) : see previous definition of 'SOMAXCONN'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(675) : warning C4005: 'FD_READ' : macro redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(571) : see previous definition of 'FD_READ'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(678) : warning C4005: 'FD_WRITE' : macro redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(572) : see previous definition of 'FD_WRITE'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(681) : warning C4005: 'FD_OOB' : macro redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(573) : see previous definition of 'FD_OOB'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(684) : warning C4005: 'FD_ACCEPT' : macro redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(574) : see previous definition of 'FD_ACCEPT'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(687) : warning C4005: 'FD_CONNECT' : macro redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(575) : see previous definition of 'FD_CONNECT'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(690) : warning C4005: 'FD_CLOSE' : macro redefinition
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(576) : see previous definition of 'FD_CLOSE'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1622) : error C2375: 'accept' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(744) : see declaration of 'accept'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1643) : error C2375: 'bind' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(749) : see declaration of 'bind'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1662) : error C2375: 'closesocket' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(754) : see declaration of 'closesocket'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1681) : error C2375: 'connect' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(756) : see declaration of 'connect'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1702) : error C2375: 'ioctlsocket' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(761) : see declaration of 'ioctlsocket'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1723) : error C2375: 'getpeername' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(766) : see declaration of 'getpeername'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1744) : error C2375: 'getsockname' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(771) : see declaration of 'getsockname'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1767) : error C2375: 'getsockopt' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(776) : see declaration of 'getsockopt'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1788) : error C2375: 'htonl' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(783) : see declaration of 'htonl'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1805) : error C2375: 'htons' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(785) : see declaration of 'htons'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1822) : error C2375: 'inet_addr' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(787) : see declaration of 'inet_addr'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1839) : error C2375: 'inet_ntoa' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(789) : see declaration of 'inet_ntoa'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1857) : error C2375: 'listen' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(791) : see declaration of 'listen'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1875) : error C2375: 'ntohl' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(795) : see declaration of 'ntohl'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1892) : error C2375: 'ntohs' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(797) : see declaration of 'ntohs'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1912) : error C2375: 'recv' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(799) : see declaration of 'recv'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1937) : error C2375: 'recvfrom' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(805) : see declaration of 'recvfrom'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1963) : error C2375: 'select' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(813) : see declaration of 'select'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(1987) : error C2375: 'send' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(820) : see declaration of 'send'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2012) : error C2375: 'sendto' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(826) : see declaration of 'sendto'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2038) : error C2375: 'setsockopt' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(834) : see declaration of 'setsockopt'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2060) : error C2375: 'shutdown' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(841) : see declaration of 'shutdown'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2080) : error C2375: 'socket' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(845) : see declaration of 'socket'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2103) : error C2375: 'gethostbyaddr' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(852) : see declaration of 'gethostbyaddr'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2122) : error C2375: 'gethostbyname' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(857) : see declaration of 'gethostbyname'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2140) : error C2375: 'gethostname' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(859) : see declaration of 'gethostname'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2159) : error C2375: 'getservbyport' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(863) : see declaration of 'getservbyport'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2178) : error C2375: 'getservbyname' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(867) : see declaration of 'getservbyname'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2196) : error C2375: 'getprotobynumber' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(871) : see declaration of 'getprotobynumber'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2213) : error C2375: 'getprotobyname' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(873) : see declaration of 'getprotobyname'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2233) : error C2375: 'WSAStartup' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(877) : see declaration of 'WSAStartup'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2251) : error C2375: 'WSACleanup' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(881) : see declaration of 'WSACleanup'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2268) : error C2375: 'WSASetLastError' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(883) : see declaration of 'WSASetLastError'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2285) : error C2375: 'WSAGetLastError' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(885) : see declaration of 'WSAGetLastError'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2302) : error C2375: 'WSAIsBlocking' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(887) : see declaration of 'WSAIsBlocking'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2319) : error C2375: 'WSAUnhookBlockingHook' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(889) : see declaration of 'WSAUnhookBlockingHook'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2336) : error C2375: 'WSASetBlockingHook' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(891) : see declaration of 'WSASetBlockingHook'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2353) : error C2375: 'WSACancelBlockingCall' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(893) : see declaration of 'WSACancelBlockingCall'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2375) : error C2375: 'WSAAsyncGetServByName' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(895) : see declaration of 'WSAAsyncGetServByName'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2402) : error C2375: 'WSAAsyncGetServByPort' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(903) : see declaration of 'WSAAsyncGetServByPort'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2428) : error C2375: 'WSAAsyncGetProtoByName' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(911) : see declaration of 'WSAAsyncGetProtoByName'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2453) : error C2375: 'WSAAsyncGetProtoByNumber' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(918) : see declaration of 'WSAAsyncGetProtoByNumber'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2478) : error C2375: 'WSAAsyncGetHostByName' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(925) : see declaration of 'WSAAsyncGetHostByName'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2505) : error C2375: 'WSAAsyncGetHostByAddr' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(932) : see declaration of 'WSAAsyncGetHostByAddr'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2528) : error C2375: 'WSACancelAsyncRequest' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(941) : see declaration of 'WSACancelAsyncRequest'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(2548) : error C2375: 'WSAAsyncSelect' : redefinition; different linkage
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(943) : see declaration of 'WSAAsyncSelect'
partoftest1.cpp(16) : error C2440: 'type cast' : cannot convert from 'void *' to 'WSAData'
No constructor could take the source type, or constructor overload resolution was ambiguous

Build log was saved at "file://c:\Documents and Settings\Eddie\My Documents\Visual Studio Projects\test1\Debug\BuildLog.htm"
Project1 - 58 error(s), 11 warning(s)


---------------------- Done ----------------------

Build: 0 succeeded, 1 failed, 0 skipped


Edit: oops! meant to use source tags. I'll leave it as is tho cause I think it makes it easier to read.

Share this post


Link to post
Share on other sites
Read the error messages carefully (which is always sound advice, if you don't understand what your compiler is telling you, you won't go very far), the compiler is complaining of type and function redefinitions. Are you including both WinSock.h and WinSock2.h? Don't you think they might each define sockets and stuff in their own way? [smile]

HINT - Your IDE has a help page for each and every compiler error message. You can either get them via F1, or look them up according to the error code.

Share this post


Link to post
Share on other sites
Your having the exact same problem that i had. The answer is very simple, but no-one seamed to know how to get it to work properly, until a friendly admin showed me the light.

Anyway, the answer, which is in the MSDN library, is that you MUST include winsock2.h before windows.h, otherwise you generate those bizzare errors, hope that helps you out mate.

Share this post


Link to post
Share on other sites

This topic is 4749 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this