Help!! error C2079: 'dummy' uses undefined class 'Wt::Auth::Dbo::AuthInfo<UserType>'
Added by Yosr Chebbi almost 10 years ago
Does anyone have an idea why this error keeps showing to me?
I was trying to compile the planner example but with the Wt::Auth module instead.
here is a part of the code:
//user.h
#ifndef USER_H_
#define USER_H_
#include
#include
#include
#include
class Entry;
namespace dbo = Wt::Dbo;
class User;
typedef Wt::Auth::Dbo::AuthInfo AuthInfo;
class User {
public:
User();
Wt::Dbo::collection< Wt::Dbo::ptr > authInfos;
dbo::collection< dbo::ptr > entries;
dbo::collection< dbo::ptr > entriesInRange(const Wt::WDate& from, const Wt::WDate& until) const;
template
void persist(Action& a)
{
dbo::hasMany(a, authInfos, dbo::ManyToOne, "user");
dbo::hasMany(a, entries, dbo::ManyToOne, "user");
}
};
//user.C
#include "User.h"
#include "Entry.h"
#include
#include
#include
DBO_INSTANTIATE_TEMPLATES(User);
using namespace Wt;
using namespace Wt::Dbo;
User::User()
{ }
collection< ptr > User::entriesInRange(const WDate& from,
const WDate& until) const
{
return entries.find()
.where("start >= ?").bind(WDateTime(from))
.where("start < ?").bind(WDateTime(until));
}
The file Entry.h is the same as in planner example.
Thanks in advance.
regards,
Yosr
Replies (2)
RE: Help!! error C2079: 'dummy' uses undefined class 'Wt::Auth::Dbo::AuthInfo<UserType>' - Added by Wim Dumon almost 10 years ago
Hello,
This is an error I've seen regularly on Windows in the recent past, since the MSVS compiler seems to require class definitions more often than other compilers (gcc and llvm). The error can usually be solved by adding an include file, since a forward declaration of the type is not sufficient for MSVS.
Best regards,
Wim.
RE: Help!! error C2079: 'dummy' uses undefined class 'Wt::Auth::Dbo::AuthInfo<UserType>' - Added by Yosr Chebbi almost 10 years ago
Hello,
That was it. I forgot to include Entry.h in some other file.
Thanks for your reply.
Best regards,
Yosr.