libpqxx: [MingW] PQencryptPasswordConn not found during Cmake configuration

While configuring the libpqxx project, I ran into a problem that CMake cannot find the PQencryptPasswordConn target (or library).

I am using MSYS2 on Windows 10.

This is my CMake configuration command:

cmake .. -DSKIP_BUILD_TEST=on -DBUILD_SHARED_LIBS=on -DPostgreSQL_INCLUDE_DIR=C:/msys64/mingw64/include/postgresql -DPostgreSQL_LIBRARY=C:/msys64/mingw64/lib/postgresql

This is my output:

-- The CXX compiler identification is GNU 10.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PostgreSQL: C:/msys64/mingw64/lib/postgresql
-- Looking for poll
-- Looking for poll - found
-- Looking for PQencryptPasswordConn
-- Looking for PQencryptPasswordConn - not found
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Generating config.h
-- Generating config.h - done
-- Configuring done
WARNING: Target "pqxx" requests linking to directory "C:/msys64/mingw64/lib/postgresql".  Targets may link only to libraries.  CMake is dropping the item.
-- Generating done
-- Build files have been written to: /home/zperv/Programming/Libraries/libpqxx/build

Does someone had familiar issues and resolved them?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 35 (20 by maintainers)

Commits related to this issue

Most upvoted comments

Fair point, but the problem is that these things change all the time. I could write it, but it would need maintaining as well. I think public discussions are better at that.

[Tense drumroll music] Here are the results: I’ve downloaded the latest version of libpqxx and managed to configure, build and make install the project without any modification or special flags. Everything works fine with Cygwin.

@tt4g and @jtv thanks for the support 💯 Maybe just add to the README to encourage people to build with Cygwin and mention the encountered issue with MinGW to avoid further issues.

I believe the steps to build on most platforms can be found from the following link.

However, since C/C++ build results vary greatly depending on the compiler and machine environment, some people may not be able to build it well.

To find out why the build fails, they check the issue. They then solve their own problems from the feedback posted in the issue. So, I’m sure your feedback will help someone.

Me? Can’t easily check that right now, sorry… But libpqxx is routinely tested against a few different major postgres versions, including a Windows build in appveyor. Just not MinGW, since I don’t have Windows myself.

On Sun, Apr 4, 2021, 18:55 Zvonimir Pervan @.***> wrote:

Yes, it finds all paths and libs, but cannot reference during the linking phase.

Btw, which exact version of PostgreSQL are you using?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jtv/libpqxx/issues/433#issuecomment-813064567, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQYDE46TVWLPBAYFMDBU63THCKYLANCNFSM42KN3HIA .