Issue installing libpqxx on WSL CentOS7 x64

75 Views Asked by At

I am trying to install libpqxx on a Windows WSL CentOS7 x64 to develop C++ code to work with PostgreSQL databases.

I already have git version 2.41 and gcc version 11

I have used the following code which almost installs the library

yum install -y https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/l/libzstd-1.5.5-1.el7.x86_64.rpm
yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
yum install -y postgresql15-server
yum install -y https://rpmfind.net/linux/centos/7.9.2009/updates/x86_64/Packages/postgresql-devel-9.2.24-9.el7_9.x86_64.rpm
yum install -y python3
source scl_source enable devtoolset-11
git clone https://github.com/jtv/libpqxx.git
cd libpqxx
./configure --disable-shared # this exits with errors
make
make install

I get the following errors when I try to configure and build libpqxx:

lob.cxx: In member function 'void pqxx::blob::resize(int64_t)':
blob.cxx:183:7: error: 'lo_truncate64' was not declared in this scope; did you mean 'lo_truncate'?
  183 |   if (lo_truncate64(raw_conn(m_conn), m_fd, size) < 0)
      |       ^~~~~~~~~~~~~
      |       lo_truncate
blob.cxx: In member function 'int64_t pqxx::blob::tell() const':
blob.cxx:193:23: error: 'lo_tell64' was not declared in this scope; did you mean 'lo_tell'?
  193 |   std::int64_t offset{lo_tell64(raw_conn(m_conn), m_fd)};
      |                       ^~~~~~~~~
      |                       lo_tell
blob.cxx: In member function 'int64_t pqxx::blob::seek(int64_t, int)':
blob.cxx:205:28: error: 'lo_lseek64' was not declared in this scope; did you mean 'lo_lseek'?
  205 |   std::int64_t seek_result{lo_lseek64(raw_conn(m_conn), m_fd, offset, whence)};
      |                            ^~~~~~~~~~
      |                            lo_lseek
make[1]: *** [Makefile:531: blob.lo] Error 1
make[1]: Leaving directory '/root/programs/libpqxx/src'
make: *** [Makefile:644: all-recursive] Error 1

Could someone kindly help me out?

0

There are 0 best solutions below