It appears that your system lacks strtoll().  You'll need to replace it
somehow.  Is your system 64-bit?  If so, strtol() should work fine.  There's
actually an #ifdef near the top of strutil.h which deals with this for other
systems.

As for the "iter has already been declared" problem, it looks like your
compiler is using very old rules regarding scope of variables declared in
for() loops.  I noticed that it is also suspiciously complaining that it
doesn't recognize the "-ansi_for_scope" flag, which it appears you specified
yourself.  Presumably getting this flag to work would fix the problem.

On Tue, Oct 27, 2009 at 11:04 PM, Jackie <[email protected]> wrote:

>
>  I tried to compile protobuf many times on different HP machines with
> version 2.1 and 2.2, but all failed. The failure reason is same as
> below. Does anybody can gimme some advice ? Thank you in advance!
>
>
> libtool: compile:  aCC -DHAVE_CONFIG_H -I. -I.. -D_REENTRANT -
> ansi_for_scope on -mthreads -c +Maked google/protobuf/io/
> zero_copy_stream_impl_lite.cc -o zero_copy_stream_impl_lite.o >/dev/
> null 2>&1
>        source='google/protobuf/stubs/strutil.cc' object='strutil.lo'
> libtool=yes \
>        DEPDIR=.deps depmode=hp2 /bin/sh ../depcomp \
>        /bin/sh ../libtool --tag=CXX   --mode=compile aCC -
> DHAVE_CONFIG_H -I. -I..    -D_REENTRANT -mthreads  -Wc,-
> ansi_for_scope,on -c -o strutil.lo `test -f 'google/protobuf/stubs/
> strutil.cc' || echo './'`google/protobuf/stubs/strutil.cc
> libtool: compile:  aCC -DHAVE_CONFIG_H -I. -I.. -D_REENTRANT -
> ansi_for_scope on -mthreads -c +Maked google/protobuf/stubs/
> strutil.cc  -DPIC -o .libs/strutil.o
> aCC: warning 901: unknown option: `-ansi_for_scope': use +help for
> online documentation.
> aCC: warning 901: unknown option: `-hreads': use +help for online
> documentation.
> aCC: warning 1913: `on' does not exist or cannot be read
> "./google/protobuf/stubs/strutil.h", line 301: error #2020: identifier
>          "strtoll" is undefined
>    return strtoll(nptr, endptr, base);
>           ^
>
> "./google/protobuf/stubs/strutil.h", line 307: error #2020: identifier
>          "strtoull" is undefined
>    return strtoull(nptr, endptr, base);
>           ^
>
> "google/protobuf/stubs/strutil.cc", line 217: error #2101: "iter" has
> already
>          been declared in the current scope
>    for (ITERATOR iter = start; iter != end; ++iter) {
>                  ^
>          detected during instantiation of "void
>                    google::protobuf::JoinStringsIterator(const
> ITERATOR &,
>                    const ITERATOR &, const char *, std::string *)
> [with
>                    ITERATOR=std::vector<std::string,
>                    std::allocator<std::string>>::const_iterator]" at
> line 228
>
> "google/protobuf/stubs/strutil.cc", line 662: warning #2177-D:
> function
>          "google::protobuf::PlaceNum" was declared but never
> referenced
>  static inline char* PlaceNum(char* p, int num, char prev_sep) {
>                      ^
>
> 3 errors detected in the compilation of "google/protobuf/stubs/
> strutil.cc".
> *** Error exit code 1
>
> Stop.
> *** Error exit code 1
>
> Stop.
> *** Error exit code 1
>
>
> Here's part of config.log:
>
>  $ ./configure CXXFLAGS=-Wc,-ansi_for_scope,on --prefix=/BEA/icscomp/
> soft/GNU
>
> ## --------- ##
> ## Platform. ##
> ## --------- ##
>
> hostname = SID-1
> uname -m = ia64
> uname -r = B.11.23
> uname -s = HP-UX
> uname -v = U
>
> /usr/bin/uname -p = unknown
> /bin/uname -X     = unknown
>
> /bin/arch              = unknown
> /usr/bin/arch -k       = unknown
> /usr/convex/getsysinfo = unknown
> /usr/bin/hostinfo      = unknown
> /bin/machine           = unknown
> /usr/bin/oslevel       = unknown
> /bin/universe          = unknown
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to