在Dev C++ 編譯 WinSock 產生以下的error:
[Linker error] undefined reference to `WSAStartup@8'
[Linker error] undefined reference to `socket@12'
[Linker error] undefined reference to `WSACleanup@0'
[Linker error] undefined reference to `htons@4'
[Linker error] undefined reference to `bind@12'
[Linker error] undefined reference to `listen@8'
[Linker error] undefined reference to `WSAAsyncSelect@16'
ld returned 1 exit status
***********************************************************
解法:
project -> project options -> in the box saying something like "other linker options" type:
加入: "-lwsock32"
或是
工具 -> 編譯器選項 -> 在連結器命令列加入以下的命令(打勾)
加入 -lwsock32
tool -> compiler options -> add the following commands when calling compiler (checked)
add -lwsock32
