Hello Kenton,

   My system is 64-bit. I wrote a small sample to test strtoll(),  and
surprisedly found it is not enabled by default, actually an extra
option "-ext" is needed.  As for the "iter has already been declared"
problem, there is also an extra option: "-Wc,ansi_for_scope,on", but
this option can not passed into autoconf directly due to its strange
form. Lucky thing is that we can enable this option by another way: "-
AA" or "-Aa". That is exactly what I've done now. Here's my compiling
command line:
$ ./configure CXXFLAGS="-ext -AA"

Unfortunately, my good luck can not last to the end :(
Another error is reported as below, which seems to tell me that aCC's
standard header file is wrong. I'm confused.
pls kindly gimme some help. THANK YOU!

"
Making all in src
    source='google/protobuf/compiler/command_line_interface.cc'
object='command_line_interface.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  -ext -Aa -c -o
command_line_interface.lo `test -f 'google/protobuf/compiler/
command_line_interface.cc' || echo './'`google/protobuf/compiler/
command_line_interface.cc
libtool: compile:  aCC -DHAVE_CONFIG_H -I. -I.. -D_REENTRANT -mthreads
-ext -Aa -c +Maked google/protobuf/compiler/command_line_interface.cc
-DPIC -o .libs/command_line_interface.o
aCC: warning 901: unknown option: `-hreads': use +help for online
documentation.
"/opt/aCC/include_std/utility", line 103: error #2144: a value of type
"const char *" cannot be used to initialize an entity of type
"std::pair<char [1], char [2]>::first_type"
          : first (__x), second (__y) { }
                   ^
          detected during:
            instantiation of "std::pair<_TypeT, _TypeU>::pair(const
std::pair<_TypeT, _TypeU>::first_type &, const std::pair<_TypeT,
_TypeU>::second_type &) [with _TypeT=char [1], _TypeU=char [2]]" at
line 181
            instantiation of "std::pair<_TypeT, _TypeU> std::make_pair
(const _TypeT &, const _TypeU &) [with _TypeT=char [1], _TypeU=char
[2]]" at line 477 of "google/protobuf/compiler/
command_line_interface.cc"

"/opt/aCC/include_std/utility", line 103: error #2144: a value of type
"const char *" cannot be used to initialize an entity of type
"std::pair<char [1], char [2]>::second_type"
          : first (__x), second (__y) { }
                                 ^
          detected during:
            instantiation of "std::pair<_TypeT, _TypeU>::pair(const
std::pair<_TypeT, _TypeU>::first_type &, const std::pair<_TypeT,
_TypeU>::second_type &) [with _TypeT=char [1], _TypeU=char [2]]" at
line 181
            instantiation of "std::pair<_TypeT, _TypeU> std::make_pair
(const _TypeT &, const _TypeU &) [with _TypeT=char [1], _TypeU=char
[2]]" at line 477 of "google/protobuf/compiler/
command_line_interface.cc"

2 errors detected in the compilation of "google/protobuf/compiler/
command_line_interface.cc".
*** Error exit code 1

Stop.
*** Error exit code 1

Stop.
*** Error exit code 1

Stop.
"

On Oct 29, 5:05 am, Kenton Varda <ken...@google.com> wrote:
> 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 <junkang.w...@gmail.com> 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 protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to