I'm not really used to this library. It's API looks really nice and apparently it does a great job storing C++ classes in a Orm fashion but that's basically all I know about it right now.
Now I must reactivate this project that's been down for about 3 years and does extensive use of QxOrm. It's a remote control for an oil industry specialized inspection tool some other team made here where I work.
Some time ago I had already compiled it successfully, but since it uses QxOrm 1.3.2, it doesn't work anymore with available boost on opensuse, and we don't think sticking to boost 1.57 is a good idea. Hence I tried to get the project running with the latest QxOrm, 1.4.5. But now I'm starting to think I was too optimistic to think I'd be able to get that code running with QxOrm 1.4.5 just by fixing compilation errors. I'm stuck the first error caused by the update and I'm hoping to get some pointers here at this forum as I'm helplessly lost at the moment:
- Code: Select all
error: static assertion failed: qx::trait::is_qx_registered<typename qx::QxSqlQueryBuilder<T>::type_sql>::value
virtual ~QxDao_Helper() { static_assert(qx::trait::is_qx_registered<typename qx::QxSqlQueryBuilder<T>::type_sql>::value, "qx::trait::is_qx_registered<typename qx::QxSqlQueryBuilder<T>::type_sql>::value"); }
From the message I can figure it looks like some T type is not a properly registered type on Qx; I also can infer that this type is probably one of clientPtr, Client or maybe one of his members; What I don't know is whether it wasn't registered at all, because of some API change, or whether it's not yet registered at the moment the affected code line is being compiled.
That's my comprehension of if it as of now. Anybody can give me any directions toward a solution?
Thank all of you that read me this far!
Whole g++ output (i've ommited some unused argument warning)
- Code: Select all
g++ -c -pipe -fPIC -g -Wall -W -D_REENTRANT -fPIC -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SQL_LIB -DQT_SCRIPT_LIB -DQT_XML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -isystem /usr/include/Qt5GStreamer -Isrc -isystem /usr/include/qwt6 -isystem /usr/include/qt5 -I../Thirdparty/QxOrm/include -I../AuriBase/include -isystem /usr/include/qt5/QtWidgets -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtSql -isystem /usr/include/qt5/QtScript -isystem /usr/include/qt5/QtXml -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/qt5/QtCore -I. -isystem /usr/include/libdrm -I. -I/usr/lib64/qt5/mkspecs/linux-g++ -o videoutils.o src/videoutils.cpp
In file included from ../Thirdparty/QxOrm/include/QxDao/QxDao_Impl.h:67,
from ../Thirdparty/QxOrm/include/QxOrm.h:112,
from ../AuriBase/include/precompiled.h:4,
from ../AuriBase/include/dbmanager.h:4,
from src/clientdialog.h:5,
from src/clientdialog.cpp:1:
../Thirdparty/QxOrm/include/QxDao/../../inl/QxDao/QxDao_Helper.inl: In instantiation of ‘qx::dao::detail::QxDao_Helper<T>::~QxDao_Helper() [with T = boost::shared_ptr<Client>]’:
../Thirdparty/QxOrm/include/QxDao/../../inl/QxDao/QxDao_FetchAll.inl:42:40: required from ‘static QSqlError qx::dao::detail::QxDao_FetchAll_Generic<T>::fetchAll(const qx::QxSqlQuery&, T&, QSqlDatabase*, const QStringList&) [with T = boost::shared_ptr<Client>]’
../Thirdparty/QxOrm/include/QxDao/../../inl/QxDao/QxDao_FetchAll.inl:174:45: required from ‘static QSqlError qx::dao::detail::QxDao_FetchAll<T>::fetchAll(const qx::QxSqlQuery&, T&, QSqlDatabase*, const QStringList&) [with T = boost::shared_ptr<Client>]’
../Thirdparty/QxOrm/include/QxDao/QxDao.h:649:54: required from ‘QSqlError qx::dao::fetch_by_query(const qx::QxSqlQuery&, T&, QSqlDatabase*, const QStringList&) [with T = boost::shared_ptr<Client>]’
src/clientdialog.cpp:39:42: required from here
../Thirdparty/QxOrm/include/QxDao/../../inl/QxDao/QxDao_Helper.inl:45:44: error: static assertion failed: qx::trait::is_qx_registered<typename qx::QxSqlQueryBuilder<T>::type_sql>::value
virtual ~QxDao_Helper() { static_assert(qx::trait::is_qx_registered<typename qx::QxSqlQueryBuilder<T>::type_sql>::value, "qx::trait::is_qx_registered<typename qx::QxSqlQueryBuilder<T>::type_sql>::value"); }
^~
In file included from ../Thirdparty/QxOrm/include/QxDao/QxSqlQueryHelper.h:68,
from ../Thirdparty/QxOrm/include/QxDao/QxSqlQueryBuilder.h:47,
from ../Thirdparty/QxOrm/include/QxOrm.h:98,
from ../AuriBase/include/precompiled.h:4,
from ../AuriBase/include/dbmanager.h:4,
from src/clientdialog.h:5,
from src/clientdialog.cpp:1:
../Thirdparty/QxOrm/include/QxDao/../../inl/QxDao/QxSqlQueryHelper_FetchAll.inl: In instantiation of ‘static void qx::dao::detail::QxSqlQueryHelper_FetchAll<T>::resolveOutput(T&, QSqlQuery&, qx::IxSqlQueryBuilder&, const QStringList&) [with T = boost::shared_ptr<Client>]’:
../Thirdparty/QxOrm/include/QxDao/../../inl/QxDao/QxDao_FetchAll.inl:67:70: required from ‘static QSqlError qx::dao::detail::QxDao_FetchAll_Generic<T>::fetchAll(const qx::QxSqlQuery&, T&, QSqlDatabase*, const QStringList&) [with T = boost::shared_ptr<Client>]’
../Thirdparty/QxOrm/include/QxDao/../../inl/QxDao/QxDao_FetchAll.inl:174:45: required from ‘static QSqlError qx::dao::detail::QxDao_FetchAll<T>::fetchAll(const qx::QxSqlQuery&, T&, QSqlDatabase*, const QStringList&) [with T = boost::shared_ptr<Client>]’
../Thirdparty/QxOrm/include/QxDao/QxDao.h:649:54: required from ‘QSqlError qx::dao::fetch_by_query(const qx::QxSqlQuery&, T&, QSqlDatabase*, const QStringList&) [with T = boost::shared_ptr<Client>]’
src/clientdialog.cpp:39:42: required from here
../Thirdparty/QxOrm/include/QxDao/../../inl/QxDao/QxSqlQueryHelper_FetchAll.inl:68:21: error: static assertion failed: qx::trait::is_qx_registered<T>::value
static_assert(qx::trait::is_qx_registered<T>::value, "qx::trait::is_qx_registered<T>::value");
]}
I'll post here the class definition and also the usage that triggered the first error:
- Code: Select all
/* part of clientdialog.cpp
I'm ommiting its includes but the important part is that ClientDialog has a clientPtr client member
*/
29 void ClientDialog::on_btnSave_clicked()
30 {
31 if (ui->name->text().isEmpty()) {
32 QMessageBox::critical(this, "Error Occurred", tr("The following fields are empty: \n * Name"));
33 return;
34 }
35
36 qx::QxSqlQuery query("WHERE Client.name = :name");
37 query.bind(":name", ui->name->text());
38
39 qx::dao::fetch_by_query(query, client); // first required from here
40
41 client->name = ui->name->text();
42 client->contact = ui->contact->text();
43
44 if (!qx::dao::save(client).isValid())
45 this->accept();
46 }
- Code: Select all
/* client.h defining Client and clientPtr */
#ifndef CLIENT_H
#define CLIENT_H
#include <QxOrm.h>
#include <boost/shared_ptr.hpp>
#include "export.h"
class Pipe;
class AURI_BASE_DLL_EXPORT Client
{
public:
typedef boost::shared_ptr<Pipe> pipePtr;
typedef std::vector<pipePtr> listPipe;
long id;
QString name;
QString contact;
listPipe pipes;
Client() : id(false) { ; }
virtual ~Client(){ ; }
};
QX_REGISTER_HPP_AURI_BASE(Client, qx::trait::no_base_class_defined, 0)
typedef boost::shared_ptr<Client> clientPtr;
typedef QList<clientPtr> listClient;
#endif // CLIENT_H