Could not find libsocket.so and libintl.so

c++

I am trying to compile some tools which used to analyze HTTP logs, when ever I type make getting following error and I am not able to locate libsocket.so and libintl.so in my file system,

gcc -o showtrace showtrace.o logparse.o utils.o -lsocket -lnsl -lintl -ldl -lm
/usr/bin/ld: cannot find -lsocket
/usr/bin/ld: cannot find -lintl
collect2: ld returned 1 exit status

how to solve this problem please help.

Best Solution

I'm not really sure about libintl, but libsocket is a library that only exists on System V-style Unixes (e.g. Solaris, HP-UX). If you're on Linux or a BSD-derivative (that includes Mac OS X), then you don't need to link to libsocket because sockets are implemented in libc which is linked in by default. Try linking without -lsocket and -lintl.

Related Question