I am trying to do some socket programming, writing a simple client-server program. But when I try to compile the program, I get this error.
gcc -o showip showip.c -lnsl -lsocket -lresolv
showip.cc: In function ‘int main(int, char**)’:
/usr/bin/ld.real: cannot find -lsocket
collect2: ld returned 1 exit status
I try to install lib doing this,
sudo apt-get install happycoders-libsocket-dev
and when I compile, I still get the same error.
How can I get rid of this ? Thanks.