Android NDK OpenCV - Invalid Arguments for substr

2019-08-12 16:38发布

I want to user my c++ code in a android/opencv/ndk project. When I paste the files into the jni folder and open them, the compiler gives me invalid argument errors for functions like substr or fwrite.

An example:

#include <string>
#include <vector>
using namespace std;
using namespace cv;
...
std::string str="We think in generalities, but we live in details.";   
std::string str2 = str.substr (12,12);   

does the compiler quit for substr with:

Invalid arguments ' Candidates are: std::basic_string,std::allocator> substr(?, ?) '

I obviously doing something wrong! I'm using OpenCV 2.4.3.2 for Android and C/C++ Dev. Tools 8.1.1 for Eclipse.

0条回答
登录 后发表回答