Search code examples
postgresqlqt5static-linking

static linking of postgresql plugin in Qt 5.5


when trying to link my linux (CentOS 7) application against static qt 5 libraries I get the following error:

debug/app_debug_plugin_import.o: In function `StaticQPSQLDriverPluginPluginInstance::StaticQPSQLDriverPluginPluginInstance()':
<src>/app_debug_plugin_import.cpp:24: undefined reference to `qt_static_plugin_QPSQLDriverPlugin

linking to the mysql plugin works.
I followed the tutorial here: http://doc.qt.io/qt-5/sql-driver.html#qpsql
And I have both plugins (libqsqlpsql.a and libqsqlmysql.a) But the mysql plugin defines the function: qt_static_plugin_QMYSQLDriverPlugin()
While the psql plugin has no equivalend function.

What am I missing.

Thanks in advance


Solution

  • It seems that is was caused by remaining compiled object files that were compiled with an old qmake (from Qt 4.7) After cleaning them up, it compiled correctly.