Search code examples
androidc++eclipsejava-native-interfacenative

JNI parsing error using Eclipse


Maybe it's my configuration problem but... My Eclipse shows error when i'm trying to do sth like this:

// let say that i have a vector like this:

std::vector<Point2f> someVec(/*init vector or sth...*/);

and i want to read a field or whatever like this:

someVec[0].x = 10;

but then Eclipse cry that it's error - x is not a property. Moreover sth like this is "invalid" too:

// both are 'invalid'
someVec.operator[](0);
// or 
someVec.at(0);

On the other hand I can do sth like this and now Eclipse doesn't see any problem:

Point2f& p = someVec[0];
p.x = 10;

This 'hack' works well:

someVec.data()[0].x;

Have ever had similar problem maybe?


Solution

  • I found an answer. I included stddef.h which define size_t and some other stuff. Now problem is solved.