Note that there are some explanatory texts on larger screens.

plurals
  1. POEclipse CDT cannot parse methods on elements in STL containers
    text
    copied!<p>I'm using Eclipse Juno with CDT to develop my C++ project with custom makefile. I am also using C++11 features, which I got to work with Eclipse's parser following advice here on SO.</p> <p>The problem is that Eclipse is unable to parse methods or fields accessed on STL container elements. E.g.:</p> <p><em>mainapp.h</em></p> <pre><code>typedef struct _PlayerCalibrationData { [...] std::string getSamplesStr() { [...] } } PlayerCalibrationData; std::vector&lt;MainApp::PlayerCalibrationData&gt; m_calibrationData; </code></pre> <p><em>mainapp.cpp</em></p> <pre><code>m_calibrationData[0].getSamplesStr(); </code></pre> <p><code>getSamplesStr()</code> will be underlined and marked as an error, with the message "Method 'getSamplesStr' could not be resolved".</p> <p>The compiler doesn't complain, though, regardless of whether I invoke it from Eclipse or from the command line.</p> <p>Also, when I type <code>m_calibrationData.</code>, all vector methods pop up via content assist (i.e. it's not an issue of Eclipse not finding the vector include), but as soon as I access an element via <code>[]</code> or <code>at()</code>, content assist is quiet and anything typed manually is marked as an error.</p> <p>Is it normal that this doesn't work? If yes, is there a way I can turn off assist/correction for template-based containers specifically?</p> <p><strong>EDIT</strong></p> <p>I now also tried disabling c++11 support, and if I do that the problem disappears -- but then of course the c++ 11 types and syntax aren't recognized.</p> <p><strong>EDIT 2</strong></p> <p>I imported a second project, entered exactly the same settings, and for this project the parsing works. The only difference is the project layout (different location of makefiles). But even if I delete and re-import the first project, it still doesn't work.</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