我使用这个网站上的指南安装了GMP:http://www.cs.nyu.edu/exact/core/gmp/,然后我寻找了一个使用该库的示例程序:
#include <iostream>
#include <gmpxx.h>
using namespace std;
int main (void) {
mpz_class a, b, c;
a = 1234;
b = "-5678";
c = a+b;
cout << "sum is " << c << "\n";
cout << "absolute value is " << abs(c) << "\n";
cin >> a;
return 0;
}
但是,如果我使用命令g++ test.cpp -o test.exe进行编译时,它会显示:gmpxx.h:没有那个文件或目录。我该如何解决这个问题?我对这方面还比较新手。而且我正在使用MinGW。