c++11 - Eclipse C++ std::vector methods invalid parameters errors -


I'm working on an Android application that uses OpenCV 2.4.9 and NDKR 9 as a dependency. I also use Eclipse 4.4 Luna as IDE with the installation of CDT Plugin 8.4.

Whenever I'm trying to use methods std :: vector.at (int), or the "[]" method, I get strange errors. For example, consider the code:

  #include & lt; Vector & gt; ......................... structure customs {int level; Point First Point, Second Point, Midwaypoint; }; ......................... Inc maxElemNr = 10; Std :: vector & lt; CustomStread & gt; CustomStructVector (maxElemNr); ......................... for (int i = 0; i & lt; customStructVector.size (); i ++) {if ( CustomStructVector.at (i) .level == 0} {}}   

at customStructVector.at (i) Eclipse tells me the following:

Invalid argument 'candidates: As a result, together with the Evidence & amp; On the (?) Continent, along with the results of Avance & amp; If I want to use the "[]" operator instead of "on (index)" method, then I get the following: As a result of the Avidha vector vector (?) '

[I] .level tells me that the field level is not found.

I'm called an expert C / C ++ sign, and I'm new to working with Java with NDK coming from the background, I can add any code to CustomStruct The call was expected to get the object of customStructVector.at (i) or customStructVector [i] . >, Such that I can then use the field level on my object to read its value.

In addition, my vector

  int maxElemNr = 10; Std :: vector & lt; CustomStruct & gt; CustomStructVector; CustomStructVector.reserve (maxElemNr);   

I found:

invalid argument 'candidates are: zero reserved (?)'

I searched Is the answer to that, and came with the principle that eclipse can not use the c + + 11 version of std library?

I have read about the vector class. Apart from this, this issue is similar to the question being asked.

will provide more information about my environment and in this way, if necessary, solve it, because it is a barrier to my project so far ..

What am I doing wrong? There was no problem in compiling and running the code before using the std :: vector class.

LE: Apparently workaround & amp; (As a result of EvidenceWater data () + i) - & gt; Level is accredited by the editor, and compiles the code, still want to use std :: vector , though it is considered in use.

I had the same problem It works in the Visual Studio compiler, but when I access the vector element If I try to do it, I get the exact same error.

Although it seems that if you do not use 'A', then this custom-operator I) Use custom architecture (I),

It is weird that I did not understand it in detail. Please note that if you have a vector, then you have to put the results to reach type of members.

Regards

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -