Note that there are some explanatory texts on larger screens.

plurals
  1. POundefined reference to Class::method C++
    text
    copied!<p>I got a problem compiling the source that follows: </p> <pre><code> QString code = this-&gt;viewManager()-&gt;activeView()-&gt;document()-&gt;text(); Qualifier qua; qua.setQCode(code); </code></pre> <p>It tells me that </p> <pre><code>error: undefined reference to `Qualifier::setQCode(QString)' </code></pre> <p>the code of the qualifier.h and .cpp follows</p> <pre><code>#ifndef __QUALIFIER_H__ #define __QUALIFIER_H__ #include &lt;iostream&gt; #include &lt;string&gt; #include &lt;QString&gt; #include &lt;queue&gt; #include "analyser.h" using namespace std; class Qualifier { private: string code; queue&lt;method&gt; tokenisedCode; //queue&lt;analysis&gt; analysedCode; void tokeniseCode(); public : void setCode(string code); void setQCode(QString code); void computeLocAnalysis(); void computeCCAnalysis(); void visualiseResults(); }; #endif /* __QUALIFIER_H__ */ </code></pre> <p>and the CPP is </p> <pre><code>#include "qualifier.h" using namespace std; void Qualifier::tokeniseCode() { Parser par; par.setCode(code); par.parse(); this-&gt;tokenisedCode = par.getMethods(); } void Qualifier::setCode(string code) { this-&gt;code = code; } void Qualifier::setQCode(QString code) { this-&gt;code = qPrintable(code); } void Qualifier::computeLocAnalysis() { std::cout &lt;&lt; this-&gt;code &lt;&lt; std::endl; /* locAnalyser ana = new locAnalyser(); ana.setMethodList(tokenisedCode); ana.computeResult(); this-&gt;analysedCode = ana.getResult(); */ } void Qualifier::computeCCAnalysis() { // To be implemented; } void Qualifier::visualiseResults() { /* //Need a grapher of the results while(!analysedCode.empty()) { analysis meth = analysedCode.front(); cout &lt;&lt; "LOC: " &lt;&lt; meth.result &lt;&lt; "\t\t" &lt;&lt; meth.name &lt;&lt; endl; analysedCode.pop(); cout &lt;&lt; "------------------------------------" &lt;&lt; endl; } */ } </code></pre> <p>I do not understand why the reference is not seen! I mean, is the exact thing, the same way that is done in the rest of the project!</p>
 

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