Prerequisites

As mentioned previously, libpgeasy is a wrapper around libpq. The basic requirements for building a libpq client were described in Chapter 8, “The PostgreSQL C API—libpq,” and so I won't repeat them here.

libpgeasy is no longer included in the core PostgreSQL distribution. If you want to try out libpgeasy, you can download it from the official PostgreSQL Projects website, gborg.postgresql.org (search for “pgeasy”). Once you've downloaded the most recent (stable) version, unpack the archive (it will be named something like libpgeasy-version.tgz) into a temporary directory and then do the typical GNU two-step to configure and compile the library. Once you've unpacked the archive, move into the newly created directory and browse through the README file—note that you have to tell the configure script how to find the libpq header files and library. If you're running a relatively recent version of PostgreSQL, you can use the pg_config utility to do the hard work for you; just run the command:

$ export CPPFLAGS=-I$(pg_config --includedir)
$ export LDFLAGS=-L$(pg_config --libdir)
./configure

If you're using an older version of PostgreSQL (a version that does not include the pg_config utility), follow the directions in the README file to configure the libpgeasy source code. When the configure script completes, execute the following command to compile and install libpgeasy:

$ make && make install

That's it. You should be ready to compile and link your own libpgeasy applications. In addition to the libpq header files and object libraries, you will need to #include the libpgeasy.h file and link to the libpgeasy object library (-lpgeasy).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.86.121