文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Dev_c++下解决编译winsock和pthread 的链接问题

Dev_c++下解决编译winsock和pthread 的链接问题

时间:2010-10-20  来源:liuanggh

在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'

编译器选项,连接器命令输入框中增加
-lwsock32

如果想编译多线程程序,在连接器命令输入框中输入
-lpthreadGC2
相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载