gmp_int Boost errors
gmp_int Boost errors
下面是我的简单测试代码:
#include <boost/multiprecision/gmp.hpp>
using namespace boost::multiprecision;
int main()
{
gmp_int v = 1;
std::cout << v << std::endl;
return 0;
}
当我尝试构建和运行时,我得到以下错误:
error: there are no arguments to 'mp_get_memory_functions' that depend on a template parameter, so a declaration of 'mp_get_memory_functions' must be available [-fpermissive]
note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
error: 'mp_get_memory_functions' was not declared in this scope
error: 'mpz_combit' was not declared in this scope
error: 'mp_get_memory_functions' was not declared in this scope|
error: invalid conversion from 'int' to 'const __mpz_struct*' [-fpermissive]
error: cannot bind 'std::ostream {aka std::basic_ostream<char>}' lvalue to 'std::basic_ostream<char>&&'
error: initializing argument 1 of 'std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&&, const _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = boost::multiprecision::backends::gmp_int]'
我正在使用Code::Blocks。我使用了预编译的windows GMP库。在代码::块我有gmpliblibgmp.a
在链接器,gmpinclude
在编译器目录和gmplib
在链接器目录。任何帮助将在GMP的工作受到赞赏。我认为我没有正确安装GMP,但这可能是一个简单的问题。
您忘记使用gmp_int
后端类型的数字适配器:
number<gmp_int> v = 1;
查看Live On Coliru:
#include <boost/multiprecision/gmp.hpp>
#include <iostream>
using namespace boost::multiprecision;
int main()
{
number<gmp_int> v = 1;
std::cout << v << std::endl;
}
我已经解决了问题。我没有正确链接所有的头文件和库文件
相关文章:
- 理解boost::asio-async_read在无需读取内容时的行为
- boost::进程间消息队列引发错误
- 如何运行位于boost/libs/python/example/tutorial目录中的hello.cpp和Jamfil
- cmake如何在fedora工作站中找到boost静态库包
- CMake项目Boost库错误:Boost/config/compiler/gcc.hpp:165:10:致命错误:cs
- Boost Graph Library,修复节点大小
- 什么是"#include <boost/functional/hash.hpp> "?
- 基于boost的程序的静态链接——zlib问题
- C++:如何在CLion IDE中安装Boost
- C++Boost Asio Pool线程,带有lambda函数和传递引用变量
- 如何在boost beast http请求中设置http头
- Boost Spirit,获取迭代器内部语义动作
- 使用 GCC 卸载的 OpenMP 卸载失败,并出现"Ptx assembly aborted due to errors"
- boost::asio::steady_timer()与sleep()我应该使用哪一个
- boost::asio如何生成多个协同程序,然后加入它们
- 当我尝试使用 sstream 和分面将 Boost Time_duration转换为字符串时,我没有得到所需的格式
- Visual Studio(或任何其他工具)能否将地址解释为调用堆栈(boost上下文)的开头
- 如何使用boost::具有嵌套结构和最小代码更改的序列化
- gmp_int Boost errors
- C++ Boost ASIO socket errors