gpt4 book ai didi

针对 GNU 多精度库的 C++ 编译错误

转载 作者:行者123 更新时间:2023-11-28 03:46:54 26 4
gpt4 key购买 nike

编译时出现以下错误 this third-party library (称为 azove 2.0)依赖于 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 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 的错误。任何指针将不胜感激。

最佳答案

我会先分摊责任。在您的项目中创建一个空的 cpp 文件,例如 test.cpp,并仅包含有问题的 gmpxx.h 文件。如果你可以编译测试 cpp,GMP 就可以摆脱困境。然后尝试仅包含有问题的 azove header 。如果您可以在其他空文件中编译 azove header ,那么 azove 就可以摆脱困境,并且您包含/定义的内容会干扰它们。缩小问题的根源后,您应该会发现更容易解决。

关于针对 GNU 多精度库的 C++ 编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7327043/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com