Witam. Potrzebna mi jest obsługa dużych liczb (ponad kilka tysięcy cyfr) i postanowiłem wykorzystać do tego tę bibliotekę http://panoramix.ift.uni.wroc.pl/~bosy/bignum.htm. Mam jednak problem - nawet przy próbie kompilowania przykładowego kodu kompilator wywala błędy:
In file included from E:/Programy/Programowanie/Dev-Cpp/include/c++/3.4.2/backward/iostream.h:31,
from E:/Programy/Programowanie/Dev-Cpp/include/l3_port.h:57,
from main.cpp:5:
E:/Programy/Programowanie/Dev-Cpp/include/c++/3.4.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
main.cpp:10: error: `Fraction' does not name a type
main.cpp: In function `int main()':
main.cpp:19: error: `Fraction' undeclared (first use this function)
main.cpp:19: error: (Each undeclared identifier is reported only once for each function it appears in.)
main.cpp:19: error: `BigCalculations' undeclared (first use this function)
main.cpp:20: error: `Number' undeclared (first use this function)
main.cpp:20: error: `Pow' undeclared (first use this function)
Kod tego pliku przykładowego:
// *BIGNUM - example 1: calculating values of polynominal an power* by Krzysztof Bosak 2000-10-05
#include <iostream>
#include <l3_port.h>
#include <l3_rand.h>
using namespace std;
const Fraction BigCalculations(const Fraction& x)
{
return Fraction(5)
+ Pow(x, 2)
+ Fraction(Number("12345678912345678945"), 100) * Pow(x, 4);
}
int main()
{
cout<<BigCalculations(Fraction(2,3))<<endl;// 17777...64980/72900
cout<<Pow(Number(2), 128)<<endl;// 34028...211456
return 0;
}
Co jest nie tak ? Jak widać używam Dev-cpp