netdb.h not linking properly

前端 未结 4 1950
面向向阳花
面向向阳花 2021-02-05 17:06

I\'m trying to compile this program, as referenced in Beej\'s Guide to Network Programming on page 19.

#include 
#include          


        
4条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-05 17:25

    Use #include ....along with that.....and in compilation (ubuntu)....

    gcc server/client -o server/client.c -lpthread
    

    (here lpthread is a linki processing thread)...which solves your problem. :-D

提交回复
热议问题