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 visiblethanks PS: /usr/include/ginac/ginac.h
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
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
On Wed, 13 Mar 2019 15:30:56 +0000 (UTC), Pedro Sosa via GiNaC-list <ginac-list@ginac.de> said:
PS> Hello, I install in my Ubuntu Ginac but I don't know how to PS> compile a basic example #include <iostream> #include PS> <ginac/ginac.h> using namespace std; using namespace GiNaC; PS> int main() { symbol x("x"), y("y"); PS> for (int i=0; i<3; ++i) poly += PS> factorial(i+16)*pow(x,i)*pow(y,2-i); PS> cout << poly << endl; return 0; } where I must put this PS> file for ginac.h can be visiblethanks PS: PS> /usr/include/ginac/ginac.h You need to add the declaration: ex poly; After that try to compile your code with the command: g++ -lginac test.cpp -o test It works on my Debian system. -- Vladimir V. Kisil http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Transformations http://goo.gl/EaG2Vu Software: Geometry of cycles http://moebinv.sourceforge.net/
participants (3)
-
Patrick Schulz
-
Pedro Sosa
-
Vladimir V. Kisil