为什么在此范围内未声明“ mpir_ui”?

时间:2020-03-30 13:32:34

标签: c++ gmp mpfr mpir

在fedora 31上安装mpir-3.0之后。现在,我尝试构建项目:

#include <stdio.h>
#include <gmp.h>
#include <mpir.h>
#include <mpfr.h>
#include <iostream>
using namespace std;



int main(int argc, char* argv[])
{

     mpf_t a;         //mpir float variable
     mpf_init(a);     //initialise a
     mpir_ui two = 2; //mpir unsigned integer variable
     FILE* stream;    //file type pointer to output on standard output (console)
     mpf_init_set_ui (a, 2);          //set value of a to 2
     mpf_out_str (stream, 10, 2, a); //output value of a
     cout << "\nMPIR working" << "\n" ;

}

但是当我编译它时,出现此错误:

‘mpir_ui’ was not declared in this scope; did you mean ‘mpfr_ai’?|

我使用了这些标志:

 -lmpir -lmpfr -lgmp

0 个答案:

没有答案
相关问题