I need a hand with some stubborn link errors.
I'm trying to recreate and old program from 6.0 into .NET, but for some reason when I try to compile I'm getting linking errors for all my function calls that deal with sockets. I've included <winsock2.h> in stdafx.h and I linked to ws2_32.lib by going to project properties->linker->general->additional library directories and typing in ws2_32.lib.
Am I missing some include files or have the wrong library or something to that extent? Perhaps I put the link to the library in the wrong spot in properties or I need to put it in my code somewhere as well. Any feedback would be greatly appreciatted. I'm pasting the errors below.
Thanks,
-Ryan
Linking...
iotake3.obj : error LNK2001: unresolved external symbol "int __stdcall closesocket(unsigned int)" (?closesocket@@$$J14YGHI@Z)
iotake3.obj : error LNK2001: unresolved external symbol "unsigned short __stdcall ntohs(unsigned short)" (?ntohs@@$$J14YGGG@Z)
iotake3.obj : error LNK2001: unresolved external symbol "unsigned long __stdcall ntohl(unsigned long)" (?ntohl@@$$J14YGKK@Z)
iotake3.obj : error LNK2001: unresolved external symbol "int __stdcall ioctlsocket(unsigned int,long,unsigned long *)" (?ioctlsocket@@$$J212YGHIJPAK@Z)
iotake3.obj : error LNK2001: unresolved external symbol "int __stdcall recv(unsigned int,char *,int,int)" (?recv@@$$J216YGHIPADHH@Z)
iotake3.obj : error LNK2001: unresolved external symbol "int __stdcall connect(unsigned int,struct sockaddr const *,int)" (?connect@@$$J212YGHIPBUsockaddr@@H@Z)
iotake3.obj : error LNK2001: unresolved external symbol "unsigned long __stdcall inet_addr(char const *)" (?inet_addr@@$$J14YGKPBD@Z)
iotake3.obj : error LNK2001: unresolved external symbol "unsigned short
__stdcall htons(unsigned short)" (?htons@@$$J14YGGG@Z)
iotake3.obj : error LNK2001: unresolved external symbol "int __stdcall setsockopt(unsigned int,int,int,char const *,int)" (?setsockopt@@$$J220YGHIHHPBDH@Z)
iotake3.obj : error LNK2001: unresolved external symbol "int __stdcall WSAGetLastError(void)" (?WSAGetLastError@@$$J10YGHXZ)
iotake3.obj : error LNK2001: unresolved external symbol "unsigned int __stdcall socket(int,int,int)" (?socket@@$$J212YGIHHH@Z)
iotake3.obj : error LNK2001: unresolved external symbol "int __stdcall WSAStartup(unsigned short,struct WSAData *)" (?WSAStartup@@$$J18YGHGPAUWSAData@@@Z)
iotake3.obj : error LNK2001: unresolved external symbol "unsigned long __stdcall htonl(unsigned long)" (?htonl@@$$J14YGKK@Z)
iotake3.obj : error LNK2001: unresolved external symbol "int __stdcall send(unsigned int,char const *,int,int)" (?send@@$$J216YGHIPBDHH@Z)
C:\Documents and Settings\rmay\My Documents\Visual Studio Projects\iotake3\Debug\iotake3.exe : fatal error LNK1120: 14 unresolved externals