[bigint] compile error (<X> on g++ 3.2.3)

Jeanna Matthews <jnm at clarkson.edu>
Fri Oct 3 06:19:41 PDT 2008


Thank you!

On Thu, Oct 2, 2008 at 9:52 PM, Matt McCutchen <matt at mattmccutchen.net>wrote:

> On Wed, 2008-10-01 at 00:21 -0500, Jeanna Matthews wrote:
> > I downloaded the package, but am having trouble compiling it with g++
> > on Linux.
> >
> > It appears not to recognize the <X> in this:
> >
> > template <class X>
> > inline X convertBigUnsignedToPrimitiveAccess(const BigUnsigned &a) {
> >         return a.convertToPrimitive<X>();
> > }
>
> > [bigint-2008.07.20]$ make
> > g++ -c -O2 -Wall -pedantic BigInteger.cc
> > BigInteger.cc: In function `X
> > convertBigUnsignedToPrimitiveAccess(const
> >    BigUnsigned&)':
> > BigInteger.cc:89: syntax error before `>' token
> > make: *** [BigInteger.o] Error 1
> > [jnm at polaris bigint-2008.07.20]$ g++ -v
> > Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/specs
> > Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
> > --infodir=/usr/share/info --enable-shared --enable-threads=posix
> > --disable-checking --with-system-zlib --enable-__cxa_atexit
> > --host=i386-redhat-linux
> > Thread model: posix
> > gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-59)
>
> Your g++ seems to dislike my use of explicit template arguments, but I'm
> surprised it didn't complain about the <X> in BigUnsigned.hh.  Consider
> upgrading g++.  I can compile the library just fine with g++ 4.3.0 and
> with g++ 3.4.6.  Alternatively, you could apply the attached patch,
> which removes the explicit template arguments.  (The patched version is
> also in branch "no-explicit-template-args" of my repository.)
>
> Matt
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mattmccutchen.net/mailman/archives/bigint/attachments/20081003/cac7d8c8/attachment.htm>


More information about the bigint mailing list