Freddy Martinez Garcia
2015-07-28 15:13:10 UTC
hi guys... I'm learning how to use Wt::Dbo and I have this piece of code:
#include <Wt/Dbo/Dbo>
using namespace std;
using namespace Wt::Dbo;
class DbUser
{
private:
string m_login;
string m_password;
string m_name;
string m_lastname;
string m_email;
public:
DbUser(const string& login,
const string& password,
const string& name,
const string& lastname,
const string& email);
inline const string& login() const noexcept {return this->m_login;}
inline const string& password() const noexcept {return
this->m_password;}
inline const string& name() const noexcept {return this->m_name;}
inline const string& lastname() const noexcept {return
this->m_lastname;}
inline const string& email() const noexcept {return this->m_email;}
template<class Action>
void persist(Action& action)
{
dbo::field(action, this->m_login, "login");
dbo::field(action,this->m_password, "password");
dbo::field(action, this->m_name, "name");
dbo::field(action, this->m_lastname, "lastname");
dbo::field(action, this->m_email, "email");
}
~DbUser(){}
};
is like the example in the doc, but I got the following error:
../WebTestStore/src/db/schema/DbUser.h: In member function 'void
DbUser::persist(Action&)':
../WebTestStore/src/db/schema/DbUser.h:35:13: error: 'dbo' has not been declared
../WebTestStore/src/db/schema/DbUser.h:36:13: error: 'dbo' has not been declared
../WebTestStore/src/db/schema/DbUser.h:37:13: error: 'dbo' has not been declared
../WebTestStore/src/db/schema/DbUser.h:38:13: error: 'dbo' has not been declared
../WebTestStore/src/db/schema/DbUser.h:39:13: error: 'dbo' has not been declared
../WebTestStore/main.cpp: In function 'int main(int, char**)':
../WebTestStore/main.cpp:9:13: warning: unused variable 'user'
[-Wunused-variable]
What is the problem ? is like the compiler didn't find dbo...
regards
*============================================="El tamaño de tus logros
depende del tamaño de tus metas." *
*C++ and Qt Senior Developer*
*Lic. Computer Science*
*Buenos Aires, Argentina*
#include <Wt/Dbo/Dbo>
using namespace std;
using namespace Wt::Dbo;
class DbUser
{
private:
string m_login;
string m_password;
string m_name;
string m_lastname;
string m_email;
public:
DbUser(const string& login,
const string& password,
const string& name,
const string& lastname,
const string& email);
inline const string& login() const noexcept {return this->m_login;}
inline const string& password() const noexcept {return
this->m_password;}
inline const string& name() const noexcept {return this->m_name;}
inline const string& lastname() const noexcept {return
this->m_lastname;}
inline const string& email() const noexcept {return this->m_email;}
template<class Action>
void persist(Action& action)
{
dbo::field(action, this->m_login, "login");
dbo::field(action,this->m_password, "password");
dbo::field(action, this->m_name, "name");
dbo::field(action, this->m_lastname, "lastname");
dbo::field(action, this->m_email, "email");
}
~DbUser(){}
};
is like the example in the doc, but I got the following error:
../WebTestStore/src/db/schema/DbUser.h: In member function 'void
DbUser::persist(Action&)':
../WebTestStore/src/db/schema/DbUser.h:35:13: error: 'dbo' has not been declared
../WebTestStore/src/db/schema/DbUser.h:36:13: error: 'dbo' has not been declared
../WebTestStore/src/db/schema/DbUser.h:37:13: error: 'dbo' has not been declared
../WebTestStore/src/db/schema/DbUser.h:38:13: error: 'dbo' has not been declared
../WebTestStore/src/db/schema/DbUser.h:39:13: error: 'dbo' has not been declared
../WebTestStore/main.cpp: In function 'int main(int, char**)':
../WebTestStore/main.cpp:9:13: warning: unused variable 'user'
[-Wunused-variable]
What is the problem ? is like the compiler didn't find dbo...
regards
*============================================="El tamaño de tus logros
depende del tamaño de tus metas." *
*C++ and Qt Senior Developer*
*Lic. Computer Science*
*Buenos Aires, Argentina*