Home > Archive > PostgreSQL for Windows > January 2006 > compile example









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author compile example
Volosatov Alexander

2006-01-26, 4:59 pm

Hi!
Try to compile libpqxx example:
#include <iostream>
#include <pqxx/pqxx>

using namespace std;
using namespace pqxx;

int main()
{
try
{
connection C;
cout << "Connected to " << C.dbname() << endl;
work W(C);
result R = W.exec("SELECT name FROM employee");
cout << "Found " << R.size() << "employees:" << endl;
for (result::const_itera
tor r = R.begin();
r != R.end();
++r)
{
cout << r[0].c_str() << endl;
}
cout << "Doubling all employees' salaries..." << endl;
W.exec("UPDATE employee SET salary=salary*2");
cout << "Making changes definite: ";
W.commit();
cout << "ok." << endl;
}
catch (const exception &e)
{
cerr << e.what() << endl;
return 1;
}
return 0;
}

Use Dev-Cpp + mingw32.

Have errors:
....
345 C:\Dev- Cpp\include\pqxx\lar
geobject.hxx `in' was not declared in this scope
345 C:\Dev- Cpp\include\pqxx\lar
geobject.hxx `out' was not declared in this scope
....
380 C:\Dev- Cpp\include\pqxx\lar
geobject.hxx there are no arguments to `eback' that depend on a template parameter, so a declaration of `eback' must be available
....
they repeates.

Please help.

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com