[Libpqxx-general] cant make it work in w32

Jeroen Vermeulen jtv at xs4all.nl
Wed Oct 29 14:19:26 UTC 2008


Sdävtaker wrote:

> 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?

I'd start out by adding a try/catch block around the code.  From what I 
see, the program could be failing with a simple connection failure, 
which the code you showed doesn't handle.

Also, make sure the output is flushed, otherwise you might get the wrong 
information.  Writing an endl at the end of each output entry should do 
the trick.


Jeroen


More information about the Libpqxx-general mailing list