Building libpq with Visual C++ or Borland C++
PostgreSQL 9.5.6 Documentation | |||
---|---|---|---|
Prev | Up | Chapter 16. Installation from Source Code on Windows | Next |
Using Visual C++ 7.1-9.0 or Borland 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 the MinGW or Visual Studio or Windows SDK method is recommended.
To build the libpq client library using Visual Studio 7.1 or later , change into the src directory and type the command:
nmake /f win32.mak
To build a 64-bit version of the libpq client library using Visual Studio 8.0 or later , change into the src directory and type in the command:
nmake /f win32.mak CPU=AMD64
See the win32.mak file for further details about supported variables.
To build the libpq client library using Borland C++ , change into the src 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 the libpq.dll file in the same directory as your applications executable file. Do not install libpq.dll into your Windows , System or System32 directory unless absolutely necessary. If this file is installed using a setup program, then it should be installed with version checking using the VERSIONINFO resource included in the file, to ensure that a newer version of the library is not overwritten.
If you are planning to do development using libpq on this machine, you will have to add the src\include and src\interfaces\libpq subdirectories of the source tree to the include path in your compiler's settings.
To use the library, you must add the libpqdll.lib file to your project. (In Visual C++, just right-click on the project and choose to add it.)