input compiling sample
Hello, i failed to compile the sample from :http://www.ginac.de/tutorial/Input_002foutput.html#Input_002foutput on Ubuntu linux with gcc-4.4.0. #include <iostream> #include <string> #include <stdexcept> #include <ginac/ginac.h> using namespace std; using namespace GiNaC; int main() { cout << "Enter an expression containing 'x': " << flush; parser reader; try { ex e = reader(cin); symtab table = reader.get_syms(); symbol x = table.find("x") != table.end() ? ex_to<symbol>(table["x"]) : symbol("x"); cout << "The derivative of " << e << " with respect to x is "; cout << e.diff(x) << "." << endl; } catch (exception &p) { cerr << p.what() << endl; } } Do you have any suggestions, i used the following command line to compile the sample: g++ -o test test1.cpp -lginac $ g++ -o test test1.cpp -lginac test1.cpp: In function »int main()«: test1.cpp:11: Error: »parser« not declared in this scope test1.cpp:11: Error: expected »;« before »reader« test1.cpp:14: Error: »reader« not declared in this scope test1.cpp:15: Error: »symtab« not declared in this scope test1.cpp:15: Error: expected »;« before »table« test1.cpp:16: Error: »table« not declared in this scopedefiniert It looks like i missed some #include <ginac/parser.h> ??? Thanks in advance Martin -- GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT! Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
Hello again, i solved the problem, i was using an older version of ginac (version 1.4.4). After uprading to current stable version 1.5.5, everything works as expected. Best regards to the GiNaC-Team -Martin Ettl <!-- --> -------- Original-Nachricht --------
Datum: Wed, 26 May 2010 12:02:59 +0200 Von: "Martin Ettl" <ettl.martin@gmx.de> An: ginac-list@ginac.de Betreff: [GiNaC-list] input compiling sample
Hello,
i failed to compile the sample from :http://www.ginac.de/tutorial/Input_002foutput.html#Input_002foutput on Ubuntu linux with gcc-4.4.0.
#include <iostream> #include <string> #include <stdexcept> #include <ginac/ginac.h> using namespace std; using namespace GiNaC;
int main() { cout << "Enter an expression containing 'x': " << flush; parser reader;
try { ex e = reader(cin); symtab table = reader.get_syms(); symbol x = table.find("x") != table.end() ? ex_to<symbol>(table["x"]) : symbol("x"); cout << "The derivative of " << e << " with respect to x is "; cout << e.diff(x) << "." << endl; } catch (exception &p) { cerr << p.what() << endl; } }
Do you have any suggestions, i used the following command line to compile the sample:
g++ -o test test1.cpp -lginac
$ g++ -o test test1.cpp -lginac test1.cpp: In function »int main()«: test1.cpp:11: Error: »parser« not declared in this scope test1.cpp:11: Error: expected »;« before »reader« test1.cpp:14: Error: »reader« not declared in this scope test1.cpp:15: Error: »symtab« not declared in this scope test1.cpp:15: Error: expected »;« before »table« test1.cpp:16: Error: »table« not declared in this scopedefiniert
It looks like i missed some #include <ginac/parser.h> ???
Thanks in advance
Martin
-- GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT! Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01 _______________________________________________ GiNaC-list mailing list GiNaC-list@ginac.de https://www.cebix.net/mailman/listinfo/ginac-list
-- GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT! Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
participants (1)
-
Martin Ettl