16.2. Buildinglibpq withVisual C++ orBorland C++ | ||||
---|---|---|---|---|
Prev | Up | Chapter 16. Installation from Source Code onWindows | Home | Next |
16.2. Buildinglibpq withVisual C++ orBorland C++
UsingVisual C++ 7.1-9.0 orBorland C++ to build libpq is only recommended if you need a version with different debug/release flags, or if you need a static library to link into an application. For normal use theMinGW orVisual Studio orWindows SDK method is recommended.
To build thelibpq client library usingVisual Studio 7.1 or later, change into thesrc
directory and type the command:
nmake /f win32.mak
To build a 64-bit version of thelibpq client library usingVisual Studio 8.0 or later, change into thesrc
directory and type in the command:
nmake /f win32.mak CPU=AMD64
See thewin32.mak
file for further details about supported variables.
To build thelibpq client library usingBorland C++, change into thesrc
directory and type the command:
make -N -DCFG=Release /f bcc32.mak
16.2.1. Generated Files
The following files will be built:
interfaces\libpq\Release\libpq.dll
The dynamically linkable frontend library
interfaces\libpq\Release\libpqdll.lib
Import library to link your programs to
libpq.dll
interfaces\libpq\Release\libpq.lib
Static version of the frontend library
Normally you do not need to install any of the client files. You should place thelibpq.dll
file in the same directory as your applications executable file. Do not installlibpq.dll
into yourWindows
,System
orSystem32
directory unless absolutely necessary. If this file is installed using a setup program, then it should be installed with version checking using theVERSIONINFO
resource included in the file, to ensure that a newer version of the library is not overwritten.
If you are planning to do development usinglibpq on this machine, you will have to add thesrc\include
andsrc\interfaces\libpq
subdirectories of the source tree to the include path in your compiler's settings.
To use the library, you must add thelibpqdll.lib
file to your project. (In Visual C++, just right-click on the project and choose to add it.)