Note that there are some explanatory texts on larger screens.

plurals
  1. POClass 'is not a template type'
    primarykey
    data
    text
    <p>What does this error mean?</p> <pre><code>Generic.h:25: error: 'Generic' is not a template type </code></pre> <p>Here's Generic.</p> <pre><code>template &lt;class T&gt; class Generic: public QObject, public CFG, public virtual Evaluator { Q_OBJECT std::string key_; std::vector&lt;std::string&gt; layouts_; std::vector&lt;std::string&gt; static_widgets_; std::map&lt;std::string, std::vector&lt;widget_template&gt; &gt; widget_templates_; std::map&lt;std::string, Widget *&gt; widgets_; int type_; LCDWrapper *wrapper_; protected: LCDText *lcdText_; public: Generic(Json::Value *config, int type); ~Generic(); void CFGSetup(std::string key); void BuildLayouts(); void StartLayout(); int GetType() { return type_; } //T *GetLCD() { return lcd_; } LCDText *GetLCDText() { return lcdText_; } virtual void Connect(){}; virtual void SetupDevice(){}; std::map&lt;std::string, Widget *&gt; Widgets(); std::string CFG_Key(); LCDWrapper *GetWrapper() { return wrapper_; } }; </code></pre> <p>Is the problem that it subclasses other classes? I tried an experiment testing that theory, but it didn't produce this error.</p> <p>Edit: Ok, so a couple of you guys pointed out I could be forward declaring Generic elsewhere without making it a template class. That's true. And when I make it a template, I get another error.</p> <p>Property.h:15: error: ISO C++ forbids declaration of 'Generic' with no type</p> <pre><code>template &lt;class T&gt; class Generic; class Property : public CFG { Generic *visitor; // line 15 bool is_valid; QScriptValue result; Json::Value *expression; public: Property(const Property &amp;prop); Property(Generic *v, Json::Value *section, std::string name, Json::Value *defval); ~Property(); bool Valid(); int Eval(); double P2N(); int P2INT(); std::string P2S(); void SetValue(Json::Value val); Property operator=(Property prop); }; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload