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

Marc Glisse marc.glisse at inria.fr
Thu Jul 9 09:04:16 UTC 2015


On Wed, 8 Jul 2015, Albert Chin wrote:

> 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 isfuns.cc
> libtool: compile:  aCC -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMPXX -I.. -AA -c isfuns.cc  +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
> --disable-cxx?

There is #include <string> at the beginning of the file, so the error 
makes little sense to me. Someone with access to that compiler would need 
to investigate. Of course if you don't need it, you can omit --enable-cxx.


-- 
Marc Glisse


More information about the gmp-bugs mailing list