many thanks it works

En miércoles, 13 de marzo de 2019 16:59:09 CET, Patrick Schulz <pschulz@posteo.de> escribió:


Hello Pedro,

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

ex poly;

above your for-loop, then it runs fine.

Kind regards,

Patrick

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
thanks

PS: /usr/include/ginac/ginac.h


_______________________________________________
GiNaC-list mailing list
GiNaC-list@ginac.de
https://www.cebix.net/mailman/listinfo/ginac-list
_______________________________________________
GiNaC-list mailing list
GiNaC-list@ginac.de
https://www.cebix.net/mailman/listinfo/ginac-list