Note that there are some explanatory texts on larger screens.

plurals
  1. POrequest for member which is of non-class type
    primarykey
    data
    text
    <p>i got this error and i am not able to solve by myself</p> <pre><code>source.cpp:85:8: error: request for member ‘put_tag’ in ‘aux’, which is of non-class type ‘Keyword()’ source.cpp:86:8: error: request for member ‘put_site’ in ‘aux’, which is of non-class type ‘Keyword()’ make: *** [source.o] Error 1 </code></pre> <p>the code which gives me this error is</p> <pre><code>Keyword aux(); aux.put_tag(word); aux.put_site(site); </code></pre> <p>I must mention that word and site are <code>char *</code> type</p> <p>Now, my Keyword class definition is this one:</p> <pre><code>class Keyword{ private: std::string tag; Stack&lt;std::string&gt; weblist; public: Keyword(); ~Keyword(); void put_tag(std::string word) { tag = word; } void put_site(std::string site) { weblist.push(site); } }; </code></pre> <p>Thank you very much!</p> <h1>Update</h1> <p>By modifying </p> <pre><code>Keyword aux(); aux.put_tag(word); aux.put_site(site); </code></pre> <p>in</p> <pre><code>Keyword aux; aux.put_tag(word); aux.put_site(site); </code></pre> <p>i got this error:</p> <pre><code>source.o: In function `Algorithm::indexSite(std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;)': source.cpp:(.text+0x2c6): undefined reference to `Keyword::Keyword()' source.cpp:(.text+0x369): undefined reference to `Keyword::~Keyword()' source.cpp:(.text+0x4a8): undefined reference to `Keyword::~Keyword()' source.o: In function `Keyword::put_site(std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;)': source.cpp:(.text._ZN7Keyword8put_siteESs[Keyword::put_site(std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;)]+0x2a): undefined reference to `Stack&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;::push(std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;)' collect2: ld returned 1 exit status make: *** [tema3] Error 1 </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    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