Hi
I am trying to access the list of fields that is returned from QueryModel
after a query. To do so, I have the following:
#include <Wt/Dbo/SqlTraits>
#include <Wt/Dbo/QueryModel>
void zztesABC::requery(void)
{
...
dbo::QueryModel<dbo::ptr<tesABC>>* data = new
dbo::QueryModel<dbo::ptr<tesABC>>();
data->setQuery(s->find<tesABC>("where user_id = ?").bind(u.id()));
std::vector<dbo::FieldInfo> fld = data->fields();
..
}
this compiles without issue but I keep getting the following linker error:
error LNK2019: unresolved external symbol "public: class std::vector<class
Wt::Dbo::FieldInfo,class std::allocator<class Wt::Dbo::FieldInfo> > const &
__thiscall Wt::Dbo::QueryModel<class Wt::Dbo::ptr<class tesABC>
>::fields(void)"
(?fie...@?$querymodel@v?$...@vtesabc@@@d...@wt@@@d...@wt@@qaeabv?$vec...@vfieldinfo@d...@wt@@v?$alloca...@vfieldinfo@d...@wt@@@std@@@std@@XZ)
referenced in function "private: void __thiscall zztesABC::requery(void)"
(?requ...@zztesabc@@AAEXXZ)
This problem does not occur and I am able to successfully access the list of
fields if I were to access the fields list from the session object, as
follows:
std::vector<dbo::FieldInfo> flds;
s->getFields("testabc", flds);
The issue with this method is that I am not able to match up the result
values to the fields after performing a query in a straightforward way.
Hence, the former approach using QueryModel is much preferred...
Any suggestions as to how to resolve the LNK2019 issue?
Thanks in advance!
Calvin
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest