1

我想在 android/opencv/ndk 项目中使用我的 c++ 代码。当我将文件粘贴到 jni 文件夹并打开它们时,编译器会为 substr 或 fwrite 等函数提供无效的参数错误。

一个例子:

#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);   

编译器是否为 substr 退出:

无效参数 ' 候选者是:std::basic_string,std::allocator> substr(?, ?) '

我显然做错了什么!我正在为 Android 和 C/C++ Dev 使用 OpenCV 2.4.3.2。Eclipse 工具 8.1.1。

4

0 回答 0