经常用DEV—CPP编译器,因为小巧便于随身携带,但是总会些问题,这里做些记录

在DEV-C++中编译含WINSOCK的代码总出现这样的问题
undefined reference to `inet_addr@4'
undefined reference to `gethostbyname@4'
undefined reference to `WSAGetLastError@0'
undefined reference to `inet_ntoa@4'
undefined reference to `WSAStartup@8'
undefined reference to `inet_ntoa@4'
undefined reference to `socket@12'
undefined reference to `htons@4'
undefined reference to `bind@12'
undefined reference to `listen@8'
undefined reference to `accept@12'
undefined reference to `recv@16'
undefined reference to `send@16'
undefined reference to `shutdown@8'
undefined reference to `closesocket@4'
undefined reference to `closesocket@4'
undefined reference to `WSACleanup@0'

project->project options 
-> parameters
在linker框中输入 
"-lwsock32"
无引号

原文地址:http://blog.chinaunix.net/space.php?uid=9950859&do=blog&cuid=2020544

相关文章:

  • 2021-12-29
  • 2021-12-30
  • 2021-09-13
  • 2021-10-04
  • 2021-07-23
  • 2021-06-20
猜你喜欢
  • 2021-06-06
  • 2022-12-23
  • 2022-01-13
  • 2021-07-13
  • 2021-12-10
  • 2021-12-08
  • 2021-08-17
相关资源
相似解决方案