2011-09-06 27 views
0

编译​​当我得到以下错误(称为azove 2.0),它依赖于GNU Multi-precision library对GNU的多精度库C++编译错误

> make 
g++ -Wall -O3 -DFIX_NUMBER_OF_SIGMDDNODE_SONS -DUSE_TIMER -I. -c conBDD.cpp -o conBDD.o 
In file included 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 

我曾尝试加入任何与以下两个行

#include <cstdlib> 

using std::strlen; 

conBDD.cpp,但错误仍然存​​在。

我不能说这是一个错误来自GNU的多精度库还是来自Azove。任何指针将不胜感激。

+0

'std :: strlen'在''中定义。另外,在'using'中只放入一个':'。我觉得GMP有这种错误似乎很奇怪,但你也可以试着'#include '。 –

+0

另外,'numeric_limits'的错误似乎是依靠在Azove的代码中使用'using namespace std;'来完成的。也许这个库中有一个bug? –

回答

2

我会以分摊责任开始。在你的项目中创建一个空的cpp文件,比如test.cpp,并只包含违规的gmpxx.h文件。如果您可以编译测试cpp,GMP就无需担心了。然后尝试仅包含违规的azove标题。如果你可以在另外一个空文件中编译azove头文件,azove就会脱钩并且你正在包含/定义的东西会干扰它们。一旦你缩小了问题的根源,你会发现修复起来更容易。