Invalid arguments for standard function calls
*Update: I need to mention that this error only occurs when I open the cpp file. When I close the file and close and open the project, the errors disappear (till I open the file again)*
I want to reuse my native c++ files in a android project. When I paste the files into the jni folder the compiler gives me invalid argument errors for functions like substr or fwrite.
The 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); // "generalities"
does the compiler quit with:
Invalid arguments ' Candidates are: std::basic_string<char,std::char_traits<char>,std::allocator<char>>
substr(?, ?) '
I obviously missed something general! I'm using OpenCV 2.4.3.2 for Android and C/C++ Dev. Tools 8.0 for Eclipse.
My Application.mk:
APP_STL := gnustl_static
APP_CPPFLAGS := -frtti -fexceptions
APP_ABI := armeabi-v7a
APP_PLATFORM := android-8
Android.mk:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
include ../../sdk/native/jni/OpenCV.mk
LOCAL_MODULE := native_sample
LOCAL_SRC_FILES := jni_part.cpp
LOCAL_LDLIBS += -llog -ldl
include $(BUILD_SHARED_LIBRARY)