Undefined Reference / Unresolved External Symbol
-
29-10-2019 - |
سؤال
I'm trying to use WinSock.h header file, but I get either one of the errors below: in VS2010 (C++):
Unresolved External Symbol to [the function included in winsock.g, e.g socket()]
in gcc command line (C):
Undefined Reference to [the function included in winsock.g, e.g socket()]
code is simple: Just including the Winsock.h header file and then
SOCKET s = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
I get an error on socket()
& closesocket()
functions...!
I searched in Stackoverflow and found several topics over this, but they all suggested a change in the header file. I can't change WinSock.h here, so I need a solution in the actual code that uses the header file. Any ideas?
لا يوجد حل صحيح
لا تنتمي إلى StackOverflow