1

Qt documentation says:

How to Build the QPSQL Plugin on Windows

Install the appropriate PostgreSQL developer libraries for your compiler. Assuming that PostgreSQL was installed in C:\psql, build the plugin as follows:

cd %QTDIR%\qtbase\src\plugins\sqldrivers
qmake -- PSQL_INCDIR=C:/psql/include PSQL_LIBDIR=C:/psql/lib/ms
nmake sub-psql

So what I did:

D:\Qt\5.3.0-64\qtbase\src\plugins\sqldrivers>"D:\Qt\5.3.0-64\qtbase\qmake\qmake.exe" -- PSQL_INCDIR="D:\pgsql\include" PSQL_LIBDIR="D:\pgsql\lib\msvc2010\x64"

What I get:

***Unknown option --
Usage: D:\Qt\5.3.0-64\qtbase\qmake\qmake.exe [mode] [options] [files]

... generic help follows there ...

So what is the correct command? I'm building this for Qt 5.3.0

Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778
  • It may have to do with the overhaul the Qt build system got in 5.8 that is still largely unreflected by documentation. https://stackoverflow.com/questions/48584298/error-while-compiling-static-qt-5-10-0-with-postgresql/48584661#48584661 https://stackoverflow.com/questions/41812121/qt-lite-and-configuration-changes-in-qt-5-8 – dtech Mar 08 '18 at 13:34
  • @dtech The `qmake` is `5.3.0` and so is the suorcecode. – Tomáš Zato Mar 08 '18 at 13:39
  • Then it must be something else. I always build sql support together with the whole of Qt, and I've never had problems aside from the config system changes. Don't take the documentation at hearth, in the case of Qt it is quite comprehensive, but because of that it is also huge and some parts of it don't see the necessary amount of maintenance. I highly doubt it is the "" - those are only there in case your paths have empty spaces in them. – dtech Mar 08 '18 at 14:11
  • I always specify the path to `qmake` and not only call it from there from command line. Unrelated: don't use `nmake` with Qt. Use `jom`. Unlike `nmake` it uses all CPU heads. – Alexander V Mar 08 '18 at 15:27
  • @AlexanderVX - jom actually happened to work by accident with MinGW, up until recently when that ceased to be the case. See here https://bugreports.qt.io/browse/QTBUG-62947 – dtech Mar 08 '18 at 22:58
  • Good to know. If and when I am back to Windows with Qt... – Alexander V Mar 08 '18 at 23:28

0 Answers0