在Solaris 11上编译libmemcached-1.0.18,在链接clients / memcapable时编译未定义的符号

时间:2014-03-18 06:57:06

标签: memcached solaris

make上调用libmemcached-1.0.18时,我收到了这些消息并且编译停止了

...
  CXX      libmemcached/libmemcachedinternal_libmemcachedutilinternal_la-backtrace.lo
  CXX      libmemcachedutil/libmemcachedinternal_libmemcachedutilinternal_la-flush.lo
  CXX      libmemcachedutil/libmemcachedinternal_libmemcachedutilinternal_la-pid.lo
  CXX      libmemcachedutil/libmemcachedinternal_libmemcachedutilinternal_la-ping.lo
  CXX      libmemcachedutil/libmemcachedinternal_libmemcachedutilinternal_la-pool.lo
  CXX      libmemcachedutil/libmemcachedinternal_libmemcachedutilinternal_la-version.lo
  CXXLD    libmemcachedinternal/libmemcachedutilinternal.la
  CXX      clients/clients_memcapable-memcapable.o
  CXX      libmemcached/clients_memcapable-byteorder.o
  CXXLD    clients/memcapable
Undefined                       first referenced
 symbol                             in file
recv                                clients/clients_memcapable-memcapable.o
send                                clients/clients_memcapable-memcapable.o
__xnet_connect                      clients/clients_memcapable-memcapable.o
__xnet_socket                       clients/clients_memcapable-memcapable.o
__xnet_getsockopt                   libmemcached/.libs/libmemcached.a(lt1-libmemcached_libmemcached_la-behavior.o)
getsockname                         libmemcached/.libs/libmemcached.a(libmemcached_libmemcached_la-server.o)
setsockopt                          libmemcached/.libs/libmemcached.a(libmemcached_libmemcached_la-connect.o)
getaddrinfo                         clients/clients_memcapable-memcapable.o
freeaddrinfo                        clients/clients_memcapable-memcapable.o
gai_strerror                        clients/clients_memcapable-memcapable.o
__xnet_sendmsg                      libmemcached/.libs/libmemcached.a(libmemcached_libmemcached_la-do.o)
shutdown                            libmemcached/.libs/libmemcached.a(libmemcached_libmemcached_la-io.o)
ld: fatal: symbol referencing errors. No output written to clients/memcapable
collect2: ld returned 1 exit status
make[1]: *** [clients/memcapable] Error 1
make[1]: Leaving directory `/home/admin/libmemcached-1.0.18'
make: *** [all] Error 2

这是./configure摘要

Configuration summary for libmemcached version 1.0.18

   * Installation prefix:       /usr/local
   * System type:               pc-solaris2.11
   * Host CPU:                  i386
   * C Compiler:                gcc (GCC) 4.5.2
   * C Flags:                   -g -O2  -Wno-unknown-pragmas -Wno-pragmas -Wall -Wextra -Wunsuffixed-float-constants -Wjump-misses-init -Wno-attributes -Waddress -Warray-bounds -Wbad-function-cast -Wchar-subscripts -Wcomment -Wfloat-equal -Wformat-security -Wformat=2 -Wformat-y2k -Wlogical-op -Wmissing-field-initializers -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wnormalized=id -Woverride-init -Wpointer-arith -Wpointer-sign -Wredundant-decls -Wshadow -Wsign-compare -Wstrict-overflow=1 -Wswitch-enum -Wundef -Wunsafe-loop-optimizations -funsafe-loop-optimizations -Wclobbered -Wunused -Wunused-result -Wunused-variable -Wunused-parameter -Wwrite-strings -fwrapv -pipe -fPIE -pie -Wpacked
   * C++ Compiler:              g++ (GCC) 4.5.2
   * C++ Flags:                 -g -O2 -Wno-unknown-pragmas -Wno-pragmas -Wall -Wextra -Wno-attributes -Waddress -Warray-bounds -Wchar-subscripts -Wcomment -Wctor-dtor-privacy -Wfloat-equal -Wformat=2 -Wformat-y2k -Wmissing-field-initializers -Wlogical-op -Wnon-virtual-dtor -Wnormalized=id -Woverloaded-virtual -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-compare -Wstrict-overflow=1 -Wswitch-enum -Wundef -Wunsafe-loop-optimizations -funsafe-loop-optimizations -Wclobbered -Wunused -Wunused-result -Wunused-variable -Wunused-parameter -Wwrite-strings -Wformat-security -fwrapv -pipe -fPIE -pie -Wpacked
   * CPP Flags:                  -fvisibility=hidden
   * LIB Flags:
   * Assertions enabled:        no
   * Debug enabled:             no
   * Shared:                    yes
   * Warnings as failure:       no
   * SASL support:              no
   * make -j:                   2
   * VCS checkout:              no

我是Unix / Linux的新手,不知道这是什么意思,我应该从哪里开始寻找。

1 个答案:

答案 0 :(得分:0)

您似乎缺少网络库中的链接。添加' -lnsl -lsocket'到您的LIB标志。