libpqxx-win32 r31721

Created 16th March, 2008 15:13 (UTC), last edited 16th March, 2008 15:42 (UTC)

This is an initial very experimental release. It's based on the technique used to build libpqxx for FOST.3™, but is not a duplicate of the exact settings or source code. Its only purpose is to get some feedback on the build mechanism used.

It can be downloaded from

Build instructions

You will require:

  • Microsoft Visual C++ 8 SP1 (it should compile without SP1 and I expect that MSVC 9 will be able to use the supplied project and solution files)
  • PostgreSQL 8.3 (earlier versions may work) — install with the development options

You will find an MSVC solution file, which contains two projects, at libpqxx-win32\win32\msvc8\msvc8.sln. One project builds the libpqxx DLL and the other builds the first test program (test000.exe).

Before attempting a build:

  • Ensure the path in libpqxx-win32\win32\msvc8\exec-test.cmd matches the location of the executables.
  • Ensure the path in the project include directories matches the location of the Postgres include directory — you may prefer to set this in the path options of your IDE rather than individually within each project.

The build process will execute the test program as part of the build process.

Making use of this in your own projects

The simplest way is to just grab the files from the win32\msvc8\install directory and redistribute these together with the client DLL files in the Postgres bin directory. If you prefer you can add the project to your solution in which case you will probably also want to change the output pathnames to match the output paths of the rest of the solution files.

Known issues & open questions

  • libpqxx is built at only warning level 3 and still has warnings. At level 4 even more warnings are produced. These should be tidied up.
  • I suspect that the default should be for auto linking to be turned off. Auto linking is less useful if libpqxx is part of the solution as the project can just be referenced for it to be used by other executables. The auto linking is turned off by defining the new macro PQXX_AUTOLINK_OFF. This is set in the project settings for the test program, but could also be set as a #define.

To do

  • Only the first test is executed. I want to include a script that will take the project settings from the first test as a basis to create project files for the other tests. This means that if you change the project settings you will want to get the base DLL to compile and the first test to run. After that a regeneration of the other project files will get the altered settings.

Categories: libpqxx-win32

Discussion for this page