I develop an application using Linux Gentoo (amd64) platform.
I have written the following code :
My header file:
- Code: Select all
#include <QxOrm.h>
namespace sdbs {
namespace ifs {
class MyClass: public BaseClass {
public:
...
};
/// data type for a MyClass pointer
typedef boost::shared_ptr<MyClass> MyClassPtr;
typedef qx::QxCollection<QString, MyClassPtr> MyClassList;
} // end namespace ifs
} // end namespace sdbs
using namespace sdbs::ifs;
QX_REGISTER_HPP(MyClass, qx::trait::no_base_class_defined, 1)
My source file:
- Code: Select all
#include "entity/MyClass.hpp"
QX_REGISTER_CPP(MyClass)
namespace qx {
template<>
void register_class(QxClass<MyClass> & t) {
MyClass::registerOrmClass(t);
}
}
...
Error log:
- Code: Select all
../src/main/cpp/entity/MyClass.cpp:14: error: expected identifier before string constant
../src/main/cpp/entity/MyClass.cpp:14: error: expected ‘,’ or ‘...’ before string constant
../src/main/cpp/entity/MyClass.cpp:14: error: expected constructor, destructor, or type conversion before ‘qx’
Is it possible to define object classes in namespace and use it with QxOrm? Is it the right way to do it?
Thanks