‘mpq_cmp_z’ was not declared in this scope

Leif Leonhardy not.really at online.de
Mon Aug 22 22:23:44 UTC 2016


Marc Glisse wrote:
> On Tue, 16 Aug 2016, Rafael Guglielmetti wrote:
> 
>> I downloaded GMP 6.1.1 from the website, and configured and built it via:
>> ./configure --prefix=/usr -enable-cxx
> 
> Using --prefix=/usr on Ubuntu seems like a bad idea (except when
> building a .deb).
> 
>> make
>> sudo make install
>>
>> When trying to #include <gmpxx.h>, I get the following errors:
>> /usr/include/gmpxx.h: In static member function ‘static int
>> __gmp_cmp_function::eval(mpq_srcptr, mpz_srcptr)’:
>> /usr/include/gmpxx.h:893:26: error: ‘mpq_cmp_z’ was not declared in
>> this scope
>>    { return mpq_cmp_z(q, z); }
>>                           ^
> 
> Most likely your compiler is picking up an old gmp.h (try compiling
> with g++ -E to see which gmp.h is used), either in /usr/local/include or
> in /usr/include/x86_64-linux-gnu.

g++ -E -v -x c++ /dev/null -o /dev/null

(also) shows the order in which include directories are searched.


-leif



More information about the gmp-bugs mailing list