undefind reference to '__imp_wsastartup'

使用Dev_C++編譯Socket代碼時,出現錯誤undefind reference to '__imp_wsastartup',如下所示

解決方法:選擇 Tools ->  Compiler Options -> General -> Add the following commands when calling the compiler:  中添加

-lwsock32

 

 

重新編譯,運行即可。

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章