[Libpqxx-general] cant make it work in w32

Sdävtaker sdavtaker at gmail.com
Tue Oct 28 17:44:09 UTC 2008


Hello,
I successfully installed and made it work in linux, but i cant make it
work in w32.
I build postgres and pqxx (last stable version both) and they succeded.
After that i created a file named main.cpp with some easy code [1] and
compiled using:
"g++ main.cpp  -ggdb -lpqxx -lpq" both OSs success the build and
create a a.out/a.exe file.
The problem is when i run it, Linux version works, connects, try the
query adn display it, Windows version does nothing and return to
prompt, i added some couts at start, linux version show them, win
version doesnt, i tried to follow it with debugger, and i get a smooth
navigation with gdb in linux, but i cant make it run in gdb for
windows since it cant move further than "{" at main start.
Can u help me a little?

[1]
#include <iostream>
#include <pqxx/pqxx>
using namespace std;

int main(int argc, char *argv[])
{
        pqxx::connection Conn("host=aaaaaaa user=postgres
password=aaaaa port=5432");
        pqxx::work Xaction(Conn, "DemoTransaction");
        pqxx::result R = Xaction.exec("SELECT 1;");
        Xaction.commit();
        cout << R.query();
    return 0;
}

Sdav


More information about the Libpqxx-general mailing list