[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Wrong order of includes breaks mpfrxx

From: Tobias Hahn
Subject: Wrong order of includes breaks mpfrxx
Date: Fri, 22 Oct 2004 14:03:16 +0200 (CEST)

Symptom: Including mpfr.h after gmpxx.h causes the compiler to produce
many "no matching function for call"-errors when including mpfrxx.h.

Probable cause: gmpxx checks for mpfr using #ifdef __MPFR_H

Solution: Include the following code in mpfr.h

#ifdef __GMP_PLUSPLUS__
#error mpfr.h must not be included after gmpxx.h

Attached is a testcase. Try to compile (should fail producing many 

gmp-4.1.4 from www.swox.com

./configure --prefix=$HOME --enable-cxx --enable-mpfr

uname -a:  
Linux gk05 2.6.5-7.108-smp #1 SMP Wed Aug 25 13:34:40 UTC 2004 i686 i686 
i386 GNU/Linux

gcc -v:
Reading specs from /usr/lib/gcc-lib/i586-suse-linux/3.3.3/specs
Configured with: ../configure --enable-threads=posix --prefix=/usr 
--with-local-prefix=/usr/local --infodir=/usr/share/info 
--mandir=/usr/share/man --enable-languages=c,c++,f77,objc,java,ada 
--disable-checking --libdir=/usr/lib --enable-libgcj 
--with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib 
--with-system-zlib --enable-shared --enable-__cxa_atexit i586-suse-linux
Thread model: posix
gcc version 3.3.3 (SuSE Linux)

./config.guess: pentium4-pc-linux-gnu
./configfsf.guess: i686-pc-linux-gnu

Attachment: t.cpp
Description: Text document

reply via email to

[Prev in Thread] Current Thread [Next in Thread]