As soon i use relations i got the problem that the builder says:
QxOrm/include/QxSerialize/QDataStream/QxSerializeQDataStream_boost_shared_ptr.h:55: Error: no match for 'operator<<' (operand types are 'QDataStream' and '<DAO_CLASS>')
if (t) { stream << (* t); }
The same error message appears with operator operator>>.
I did the relationship the same way as the tutorial on the homepage of QxOrm and the tests in the downloaded sources it do.
Is that maybe a known error message? Can anybody help me to interpret this error message? After some time trying out to fix the problem, i have no idea what i can do.
Class 1:
- Code: Select all
#ifndef _CLASS_CLASS1_H_
#define _CLASS_CLASS1_H_
#include <QxPrecompiled.h> // Precompiled-header with '#include <QxOrm.h>' and '#include "export.h"'
#include <QxOrm.h>
#include <QxMemLeak.h> // Automatic memory leak detection
class Class2;
class QX_DLL_EXPORT Class1
{
public:
typedef boost::shared_ptr<Class2> class2_ptr;
long id;
QString name;
int duration;
class2_ptr class2;
Class1() : id(0) { ; }
virtual ~Class1() { ; }
};
QX_REGISTER_HPP(Class1, qx::trait::no_base_class_defined, 1)
typedef boost::shared_ptr<Class1> class1_ptr;
typedef QList<class1_ptr> list_class1;
/* This macro is necessary to register 'drug' class in QxOrm context */
/* param 1 : the current class to register => 'drug' */
/* param 2 : the base class, if no base class, use the qx trait => 'qx::trait::no_base_class_defined' */
/* param 3 : the class version used by serialization to provide 'ascendant compatibility' */
#endif // _CLASS_CLASS1_H_
Class2:
- Code: Select all
#ifndef _CLASS_CLASS2_H_
#define _CLASS_CLASS2_H_
#include "class1.h"
#include <QxPrecompiled.h> // Precompiled-header with '#include <QxOrm.h>' and '#include "export.h"'
#include <QxOrm.h>
#include <QxMemLeak.h> // Automatic memory leak detection
class QX_DLL_EXPORT Class2
{
public:
long id;
QString name;
list_class1 class1;
Class2() : id(0) { ; }
virtual ~Class2() { ; }
};
QX_REGISTER_HPP(Class2, qx::trait::no_base_class_defined, 1)
typedef boost::shared_ptr<Class2> Class2_ptr;
typedef QList<Class2_ptr> list_class2;
/* This macro is necessary to register 'drug' class in QxOrm context */
/* param 1 : the current class to register => 'drug' */
/* param 2 : the base class, if no base class, use the qx trait => 'qx::trait::no_base_class_defined' */
/* param 3 : the class version used by serialization to provide 'ascendant compatibility' */
#endif // _CLASS_CLASS2_H_