I'm a problem when I compile a simple program with socket function like "send", "recv", "AccepteClients", "socket", "closesocket"... in Windows.
I have included <windows.h>, <winsock.h> and all other header files required by the various functions, but this is the output of compiler:
undefined reference to `WSAStartup@8'
undefined reference to `socket@12'
undefined reference to `htons@4'
undefined reference to `bind@12'
undefined reference to `closesocket@4'
undefined reference to `listen@8'
undefined reference to `accept@12'
undefined reference to `send@16'
undefined reference to `recv@16'
undefined reference to `gethostbyaddr@12'
undefined reference to `inet_ntoa@4'
Then, which it could be the problem?
Tanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I'm a problem when I compile a simple program with socket function like "send", "recv", "AccepteClients", "socket", "closesocket"... in Windows.
I have included <windows.h>, <winsock.h> and all other header files required by the various functions, but this is the output of compiler:
undefined reference to `WSAStartup@8'
undefined reference to `socket@12'
undefined reference to `htons@4'
undefined reference to `bind@12'
undefined reference to `closesocket@4'
undefined reference to `listen@8'
undefined reference to `accept@12'
undefined reference to `send@16'
undefined reference to `recv@16'
undefined reference to `gethostbyaddr@12'
undefined reference to `inet_ntoa@4'
Then, which it could be the problem?
Tanks!
project->project options
in the box saying something like "other linker options" type:
"-lwsock32"
Thanks !!!
I'm very happy !!!!
It's good now !!!
Thanks !!!!!!!!!!!!!!