Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

lsocket library not found on a mac

Tags:

c++

c

sockets

I need to do some socket programming on Mac OS X but I'm missing the library for it? This is what happens when I compile:

gcc ser.c -o ser -lsocket -lnsl
ser.c: In function ‘main’:
ser.c:41: warning: format ‘%.24s’ expects type ‘char *’, but argument 6 has type ‘int’
ld: library not found for -lsocket
collect2: ld returned 1 exit status

How do I get this library?

like image 638
user1834372 Avatar asked Apr 13 '26 14:04

user1834372


1 Answers

You don't need -lsocket on OS X.

like image 102
nneonneo Avatar answered Apr 16 '26 04:04

nneonneo