Hey Jan,

2011/1/8 Jan Köster <[email protected]>:
> i have solve this problem now i have problem with this template:
>
> template<>
> struct Wt::Dbo::dbo_traits<Twitter> : public Wt::Dbo::dbo_default_traits {
>  static const char *versionField() {
>    return 0;
>  }
> };
>
> i got from gcc this:
> In file included from
> /local/administrator/projects/tuxist/twitter/src/twitter.cpp:21:
> /local/administrator/projects/tuxist/twitter/src/twitter.h:79: error:
> specialization of ‘Wt::Dbo::dbo_traits<Twitter>’ after instantiation
> /local/administrator/projects/tuxist/twitter/src/twitter.h:79: error:
> redefinition of ‘struct Wt::Dbo::dbo_traits<Twitter>’
> /usr/include/Wt/Dbo/ptr:207: error: previous definition of ‘struct
> Wt::Dbo::dbo_traits<Twitter>’
> make[2]: *** [src/CMakeFiles/twitter.fcgi.dir/twitter.o] Fehler 1
> make[1]: *** [src/CMakeFiles/twitter.fcgi.dir/all] Fehler 2
> make: *** [all] Fehler 2
>
> what is the problem ?

In C++, a template specialization (like the one you define here of
dbo_traits for Twitter), needs to be declared before the template is
first used.

Thus, your template specialization itself is fine, but you need to
move it preceding any reference of class Twitter. Thus:

class Twitter;

namespace Wt {
  namespace Dbo {
    ..
  }
}

class Twitter : public ...
{

}

See also example/feature/dbo/tutorial5.C

Regards,
koen

------------------------------------------------------------------------------
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to 
best implement a security strategy that keeps consumers' information secure 
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl 
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to