[GiNaC-list] Compilation

Patrick Schulz pschulz at posteo.de
Wed Mar 13 16:49:13 CET 2019


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 at ginac.de
> https://www.cebix.net/mailman/listinfo/ginac-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cebix.net/pipermail/ginac-list/attachments/20190313/0e40378f/attachment.html>


More information about the GiNaC-list mailing list