title: Static linking of libpq++ postgresql in C++
body: <p>I am moving an application from MySQL to Postgres. When I try to compile a simple application that connects to the database, I can link it with <code>libpq.lib</code> and have a successful compilation and execution. However, this requires me to to include about 8 <code>.dll</code> files in the directory of my program which is very aggravating. Is there a way to statically link <code>libpq.lib</code> so I do not need any <code>.dll</code> files? I am on Windows7 x64 and I am trying to target building a architecture independent application that works on x64 and x86 windows. I am using libpq version 8.4.9.1. Thanks!</p>
  
  <p>Update: I have tried adding <code>#define PQ_STATIC</code> and <code>-static</code> to the linker flags. I have also compiled <code>libpq.a</code> from source but none of the above have worked.</p>