pschulz at posteo.de
Wed Mar 13 16:49:13 CET 2019
that is more a matter of your compiler and your system than of GiNaC.
Since you are on ubunte and ginac.h is already in /usr/include/..., the
program can be compiled with
g++ program.cpp -lginac
(-lginac tells the linker to load the library).
However, your program has an error, since poly is not defined. Add
above your for-loop, then it runs fine.
On 3/13/19 4:30 PM, Pedro Sosa via GiNaC-list wrote:
> Hello, I install in my Ubuntu Ginac but I don't know how to compile a
> basic example
> #include <iostream>
> #include <ginac/ginac.h>
> using namespace std;
> using namespace GiNaC;
> int main()
> symbol x("x"), y("y");
> for (int i=0; i<3; ++i)
> poly += factorial(i+16)*pow(x,i)*pow(y,2-i);
> cout << poly << endl;
> return 0;
> where I must put this file for ginac.h can be visible
> PS: /usr/include/ginac/ginac.h
> GiNaC-list mailing list
> GiNaC-list at ginac.de
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the GiNaC-list