开发者

C++ Compilation error against GNU's Multi-precision library

开发者 https://www.devze.com 2023-04-03 15:58 出处:网络
I get the following error when compiling this third-party library (called azove 2.0) which relies on the GNU Multi-precision library:

I get the following error when compiling this third-party library (called azove 2.0) which relies on the GNU Multi-precision library:

> make
g++ -Wall -O3 -DFIX_NUMBER_OF_SIGMDDNODE_SONS -DUSE_TIMER -I. -c conBDD.cpp -o conBDD.o
In file included 开发者_C百科from conBDDnode.hpp:27,
                 from conBDD.hpp:25,
                 from conBDD.cpp:22:
/usr/include/gmpxx.h: In destructor ‘__gmp_alloc_cstring::~__gmp_alloc_cstring()’:
/usr/include/gmpxx.h:2096: error: ‘strlen’ was not declared in this scope
conBDD.cpp: In member function ‘void conBDD::build()’:
conBDD.cpp:61: error: ‘numeric_limits’ was not declared in this scope
conBDD.cpp:61: error: expected primary-expression before ‘int’
conBDD.cpp:61: error: expected `;' before ‘int’
conBDD.cpp:68: error: expected primary-expression before ‘int’
conBDD.cpp:68: error: expected `;' before ‘int’
make: *** [conBDD.o] Error 1

I have tried adding either and both of the following lines

#include <cstdlib> 

using std::strlen;

to conBDD.cpp, but the error persists.

I can't tell if this is an error comes from GNU's Multi-precision library or from Azove. Any pointers would be greatly appreciated.


I would start by apportioning blame. Create an empty cpp file, say test.cpp, in your project and include only the offending gmpxx.h file. If you can compile test cpp, GMP is off the hook. Then try including only the offending azove header. If you can compile the azove header in an otherwise empty file, azove is off the hook and something you are including/defining is interfering with them. Once you have narrowed down the source of the problem you should find it easier to fix.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号