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
- Stop using `strnlen`. (#433) For some reason MinGW seems to detect (at least in one case) a working `strnlen` but then doesn't find it during compilation. Never mind. It was only a pointless micro... — committed to jtv/libpqxx by jtv 3 years ago
- Avoid `isascii()`; it's not "standard." See #433: MinGW does not seem to support it. — committed to jtv/libpqxx by jtv 3 years ago
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
libpqxxand managed to configure, build andmake installthe 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
Cygwinand mention the encountered issue withMinGWto 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: