Hello OxOrm Community,
i am interested about OxOrm Library and wanted to try an Example.
I`ve oriented at the Quick-Start Example from the Webpage.
That is my Test-Class:
#ifndef _CLASS_STAND_H_
#define _CLASS_STAND_H_
class Stand
{
public:
long id;
QString caption;
Stand() : id(0) { ; }
virtual ~Stand() { ; }
};
QX_REGISTER_HPP_MY_TEST_EXE(Stand, qx::trait::no_base_class_defined, 1)
/* This macro is necessary to register 'Stand' 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_STAND_H_
And the Defination .cpp File belonging to the class:
#include "StdAfx.h"
#include "precompiled.h" // Precompiled-header with '#include <QxOrm.h>' and '#include "export.h"'
#include "stand.h" // Class definition 'drug'
#include <QxMemLeak.h> // Automatic memory leak detection
QX_REGISTER_CPP_MY_TEST_EXE(Stand) // This macro is necessary to register 'drug' class in QxOrm context
namespace qx {
template <> void register_class(QxClass<Stand> & t)
{
t.id(& Stand::id, "id"); // Register 'Stand::id' <=> primary key in your database
t.data(& Stand::caption, "caption", 1); // Register 'Stand::name' property with key 'name' and version '1'
}}
I use Visual Studio 2008.
When i want to compile my Example, the Compiler says:
error C2259: 'qx::trait::no_base_class_defined': Instanz von abstrakter Klasse kann nicht erstellt werden aufgrund folgender Member:
"void qx::trait::no_base_class_defined::dummy(void)": ist abstrakt
D:\QxOrm\include\QxTraits/get_base_class.h(50): Siehe Deklaration von 'qx::trait::no_base_class_defined::dummy'
When i modify the Macro-Names QX_REGISTER_CPP_MY_TEST_EXE and QX_REGISTER_HPP_MY_TEST_EXE to QX_REGISTER_CPP and QX_REGISTER_HPP, the Project will be compiled, but the Linker says:
error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""protected: __thiscall boost::archive::detail::basic_oserializer::basic_oserializer(class boost::serialization::extended_type_info const &)" (??0basic_oserializer@detail@archive@boost@@IAE@ABVextended_type_info@serialization@3@@Z)" in Funktion ""public: __thiscall boost::archive::detail::oserializer<class boost::archive::xml_oarchive,class QObject>::oserializer<class boost::archive::xml_oarchive,class QObject>(void)" (??0?$oserializer@Vxml_oarchive@archive@boost@@VQObject@@@detail@archive@boost@@QAE@XZ)".
How must i modify the Macro name or my class that the Project will be compiled and QxORM can be used?
Many Thanks!