Problems building on HP-UX/PA with --enable-cxx

Albert Chin gmp-bugs at
Thu Jul 9 02:12:06 UTC 2015

I tried building gmp-6.0.0a on HP-UX 11.31/PA with --enable-cxx and
encountered a build problem for the C++ component:
  $ gtar Jxf gmp-6.0.0a.tar.xz
  $ cd gmp-6.0.0
  gmp-6.0.0$ ./configure CXX=aCC CXXFLAGS="-AA" \
  M4=/opt/fsw/m414/bin/gm4 --enable-cxx
    Version:           GNU MP 6.0.0
    Host type:         hppa2.0w-hp-hpux11.31
    ABI:               2.0w
    Install prefix:    /usr/local
    Compiler:          cc
    Static libraries:  yes
    Shared libraries:  yes
  gmp-6.0.0$ gmake
gmake[2]: Entering directory `/opt/build/china/gmp-6.0.0/cxx'
/bin/sh ../libtool --tag=CXX   --mode=compile aCC -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMPXX -I..    -AA -c -o isfuns.lo
libtool: compile:  aCC -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMPXX -I.. -AA -c  +Z -DPIC -o .libs/isfuns.o
Error 548: "../gmpxx.h", line 1435 # The expression on the left side of the
    '.' (dot member access operator) must be a completed class object type;
    the type of the left side is 'const tentative class
    basic_string<char,std::char_traits<char>,std::allocator<char> >' and
    'class basic_string<char,std::char_traits<char>,std::allocator<char> >'
    has not been defined yet.
        if (mpz_init_set_str(mp, s.c_str(), base) != 0)
Error 305: "../gmpxx.h", line 1479 # Function definitions must return
    completed object type or void.
      std::string get_str(int base = 10) const
Error 537: "../gmpxx.h", line 1482 # Cannot create a
    'basic_string<char,std::char_traits<char>,std::allocator<char> >' object;
    class basic_string<char,std::char_traits<char>,std::allocator<char> > has
    only been seen as an incomplete declaration.
        return std::string(temp.str);

gmake[2]: *** [isfuns.lo] Error 1
gmake[2]: Leaving directory `/opt/build/china/gmp-6.0.0/cxx'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/opt/build/china/gmp-6.0.0'
gmake: *** [all] Error 2

So the HP-UX/PA compiler seems to think std::string is not a complete
type? Is the compiler making any sense or should we just build with

albert chin (china at

More information about the gmp-bugs mailing list