libmemcached/parse.cc:59: error: 'index' was not declared in this scope

Asked by Julien Syx on 2011-08-19

Hello,

I'm trying to make libmemcached on a solaris 10 with gcc 4.2.1
Configuration summary for libmemcached version 0.51

   * Installation prefix: /usr/local
   * System type: pc-solaris2.10
   * Host CPU: i386
   * C Compiler: gcc (GCC) 4.2.1
   * Assertions enabled: yes
   * Debug enabled: no
   * Warnings as failure: no

Here is my env :
CC=/usr/local/bin/gcc
CFLAGS=-O2 -m64
CXXFLAGS=-O2 -m64

Solaris# /usr/local/bin/gcc --version
gcc (GCC) 4.2.1

Here is the complete error I have :

dtrace -64 -h -o libmemcached/dtrace_probes.h -s ./libmemcached/libmemcached_probes.d
gmake all-am
gmake[1]: Entering directory `/root/libmemcached-0.51'
  CXX libmemcached/options/libmemcached_libmemcached_la-parser.lo
  CXX libmemcached/options/libmemcached_libmemcached_la-scanner.lo
  CXX libhashkit/libmemcached_libmemcached_la-algorithm.lo
  CXX libhashkit/libmemcached_libmemcached_la-behavior.lo
  CXX libhashkit/libmemcached_libmemcached_la-crc32.lo
  CXX libhashkit/libmemcached_libmemcached_la-digest.lo
  CXX libhashkit/libmemcached_libmemcached_la-fnv.lo
  CXX libhashkit/libmemcached_libmemcached_la-function.lo
  CXX libhashkit/libmemcached_libmemcached_la-hashkit.lo
  CXX libhashkit/libmemcached_libmemcached_la-jenkins.lo
  CXX libhashkit/libmemcached_libmemcached_la-ketama.lo
  CXX libhashkit/libmemcached_libmemcached_la-md5.lo
  CXX libhashkit/libmemcached_libmemcached_la-one_at_a_time.lo
  CXX libhashkit/libmemcached_libmemcached_la-str_algorithm.lo
  CXX libhashkit/libmemcached_libmemcached_la-strerror.lo
  CXX libhashkit/libmemcached_libmemcached_la-murmur.lo
  CXX libmemcached/libmemcached_libmemcached_la-allocators.lo
  CXX libmemcached/libmemcached_libmemcached_la-analyze.lo
  CC libmemcached/libmemcached_libmemcached_la-array.lo
  CXX libmemcached/libmemcached_libmemcached_la-auto.lo
  CXX libmemcached/libmemcached_libmemcached_la-backtrace.lo
  CXX libmemcached/libmemcached_libmemcached_la-behavior.lo
  CXX libmemcached/libmemcached_libmemcached_la-byteorder.lo
  CXX libmemcached/libmemcached_libmemcached_la-callback.lo
  CXX libmemcached/libmemcached_libmemcached_la-connect.lo
  CXX libmemcached/libmemcached_libmemcached_la-delete.lo
  CXX libmemcached/libmemcached_libmemcached_la-do.lo
  CXX libmemcached/libmemcached_libmemcached_la-dump.lo
  CXX libmemcached/libmemcached_libmemcached_la-error.lo
  CXX libmemcached/libmemcached_libmemcached_la-fetch.lo
  CXX libmemcached/libmemcached_libmemcached_la-flush.lo
  CXX libmemcached/libmemcached_libmemcached_la-flush_buffers.lo
  CXX libmemcached/libmemcached_libmemcached_la-get.lo
  CXX libmemcached/libmemcached_libmemcached_la-hash.lo
  CXX libmemcached/libmemcached_libmemcached_la-hosts.lo
  CXX libmemcached/libmemcached_libmemcached_la-initialize_query.lo
  CXX libmemcached/libmemcached_libmemcached_la-io.lo
  CXX libmemcached/libmemcached_libmemcached_la-key.lo
  CXX libmemcached/libmemcached_libmemcached_la-memcached.lo
  CXX libmemcached/libmemcached_libmemcached_la-options.lo
  CXX libmemcached/libmemcached_libmemcached_la-parse.lo
libmemcached/parse.cc: In function 'memcached_server_st* memcached_servers_parse(const char*)':
libmemcached/parse.cc:59: error: 'index' was not declared in this scope
gmake[1]: *** [libmemcached/libmemcached_libmemcached_la-parse.lo] Error 1
gmake[1]: Leaving directory `/root/libmemcached-0.51'
gmake: *** [all] Error 2

Have you any idea please ? What is missing ?

Thanks !

Question information

Language:
English Edit question
Status:
Solved
For:
libmemcached Edit question
Assignee:
No assignee Edit question
Solved by:
Hugo Beauzée-Luyssen
Solved:
2011-08-19
Last query:
2011-08-19
Last reply:
2011-08-19
Julien Syx (julien-syx) said : #1

The following command caused the error:
echo " CXX " libmemcached/libmemcached_libmemcached_la-parse.lo;/bin/bash ./libtool --silent --tag=CXX --mode=compile /usr/local/bin/g++ -DHAVE_CONFIG_H -I. -I. -g -I/usr/local/include -D_REENTRANT -pthreads -pipe -std=gnu++98 -O2 -pedantic -Wall -Wundef -Wshadow -fdiagnostics-show-option -Wstrict-aliasing -Wswitch-enum -Wextra -Wformat -Wno-format-nonliteral -Wno-format-security -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wno-long-long -Wredundant-decls -DBUILDING_LIBMEMCACHED -O2 -m64 -MT libmemcached/libmemcached_libmemcached_la-parse.lo -MD -MP -MF libmemcached/.deps/libmemcached_libmemcached_la-parse.Tpo -c -o libmemcached/libmemcached_libmemcached_la-parse.lo `test -f 'libmemcached/parse.cc' || echo './'`libmemcached/parse.cc
make: Fatal error: Command failed for target `libmemcached/libmemcached_libmemcached_la-parse.lo'

You're missing an include to <strings.h> or <cstrings> in C++
I'd say this should be in common.h
(Please note that this builds fine on linux, so my advice is untested)

Julien Syx (julien-syx) said : #3

Thanks Hugo Beauzée-Luyssen, that solved my question.