Compiling on Solaris 9

Garrett Rooney rooneg at electricjellyfish.net
Fri Sep 2 08:10:54 PDT 2005


Mike Pacific wrote:
> Hey all,
> 
>  
> 
> I’m trying to compile and install memcached on Solaris 9. On make, I get 
> the following:
> 
>  
> 
> bash-2.05# make
> 
> make  all-recursive
> 
> make[1]: Entering directory `/root/memcached-1.1.12'
> 
> Making all in doc
> 
> make[2]: Entering directory `/root/memcached-1.1.12/doc'
> 
> make[2]: Nothing to be done for `all'.
> 
> make[2]: Leaving directory `/root/memcached-1.1.12/doc'
> 
> make[2]: Entering directory `/root/memcached-1.1.12'
> 
> gcc -DHAVE_CONFIG_H -I. -I. -I.    -DNDEBUG -g -O2 -I/usr/local/include 
> -c memcached.c
> 
> gcc -DHAVE_CONFIG_H -I. -I. -I.    -DNDEBUG -g -O2 -I/usr/local/include 
> -c slabs.c
> 
> gcc -DHAVE_CONFIG_H -I. -I. -I.    -DNDEBUG -g -O2 -I/usr/local/include 
> -c items.c
> 
> gcc -DHAVE_CONFIG_H -I. -I. -I.    -DNDEBUG -g -O2 -I/usr/local/include 
> -c assoc.c
> 
> gcc -DNDEBUG -g -O2 -I/usr/local/include -L/usr/local/lib -o memcached  
> memcached.o slabs.o items.o assoc.o  -levent
> 
> Undefined                       first referenced
> 
>  symbol                             in file
> 
> socket                              memcached.o  (symbol belongs to 
> implicit dependency /usr/lib/libsocket.so.1)
> 
> mallinfo                            memcached.o
> 
> daemon                              memcached.o
> 
> accept                              memcached.o  (symbol belongs to 
> implicit dependency /usr/lib/libsocket.so.1)
> 
> bind                                memcached.o  (symbol belongs to 
> implicit dependency /usr/lib/libsocket.so.1)
> 
> setsockopt                          memcached.o  (symbol belongs to 
> implicit dependency /usr/lib/libsocket.so.1)
> 
> inet_aton                           memcached.o
> 
> listen                              memcached.o  (symbol belongs to 
> implicit dependency /usr/lib/libsocket.so.1)
> 
> ld: fatal: Symbol referencing errors. No output written to memcached
> 
> collect2: ld returned 1 exit status
> 
> make[2]: *** [memcached] Error 1
> 
> make[2]: Leaving directory `/root/memcached-1.1.12'
> 
> make[1]: *** [all-recursive] Error 1
> 
> make[1]: Leaving directory `/root/memcached-1.1.12'
> 
> make: *** [all-recursive-am] Error 2
> 
>  
> 
>  
> 
> Any suggestions?

IIRC that kind of error on Solaris means you're not linking to the 
socket libraries.  Unlike most Unix systems Solaris doesn't keep the 
sockets code in libc.  Try adding -lnsl -lsocket to LDFLAGS and seeing 
if that helps things along.

-garrett


More information about the memcached mailing list