Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/152.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 创建一个c+的元素+;JNI中的类 < >我想创建一个自己的C++类元素。 我的JNI功能: JNIEXPORT void JNICALL Java_com_example_telo3_Process_inicializar_1nativo (JNIEnv *, jobject){ Almacena almacena; } 和Almacena是C++类: #pragma once #include <opencv2/objdetect/objdetect.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <iostream> #include <stdio.h> using namespace std; using namespace cv; class Almacena { private: std::vector<Rect> myfaces; std::vector<Rect> myeyes_r; std::vector<Rect> myeyes_l; std::vector<Rect> mynoses; std::vector<Rect> mymouths; Point2f P0; Point2f P1; Point2f P2; Point2f P3; public: Almacena(void); ~Almacena(void); void set_faces(std::vector<Rect> faces); void set_eyes_r(std::vector<Rect> eyes_r); void set_eyes_l(std::vector<Rect> eyes_l); void set_noses(std::vector<Rect> noses); void set_mouths(std::vector<Rect> mouths); void set_P0(Point2f aux); void set_P1(Point2f aux1); void set_P2(Point2f aux2); void set_P3(Point2f aux3); std::vector<Rect> get_faces(); std::vector<Rect> get_eyes_r(); std::vector<Rect> get_eyes_l(); std::vector<Rect> get_noses(); std::vector<Rect> get_mouths(); Point2f get_P0(); Point2f get_P1(); Point2f get_P2(); Point2f get_P3(); }; #pragma一次 #包括 #包括 #包括 #包括 #包括 使用名称空间std; 使用名称空间cv; 阿拉木图班 { 私人: std::向量myfaces; std::向量myyes\u r; std::向量myeyes\u l; std::媒介mynoses; std::媒介Mymouts; 点2f-P0; 点2f P1; 点2f P2; 点2f-P3; 公众: 阿拉木图(作废); ~Almacena(无效); void set_面(标准::向量面); 无效集(标准::向量眼); 无效集(标准::向量眼); 无效集_鼻(标准::向量鼻); 空集嘴(标准:向量嘴); 无效集_P0(点2f辅助); 无效集_P1(点2f aux1); 空集_P2(点2f aux2); 无效集_P3(点2f aux3); std::vector get_faces(); std::vector get_eyes_r(); std::vector get_eyes_l(); std::vector get_noses(); std::vector get_mouts(); 点2f get_P0(); 点2f get_P1(); 点2f get_P2(); 点2f get_P3(); };_Android_C++_Eclipse_Java Native Interface - Fatal编程技术网

Android 创建一个c+的元素+;JNI中的类 < >我想创建一个自己的C++类元素。 我的JNI功能: JNIEXPORT void JNICALL Java_com_example_telo3_Process_inicializar_1nativo (JNIEnv *, jobject){ Almacena almacena; } 和Almacena是C++类: #pragma once #include <opencv2/objdetect/objdetect.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <iostream> #include <stdio.h> using namespace std; using namespace cv; class Almacena { private: std::vector<Rect> myfaces; std::vector<Rect> myeyes_r; std::vector<Rect> myeyes_l; std::vector<Rect> mynoses; std::vector<Rect> mymouths; Point2f P0; Point2f P1; Point2f P2; Point2f P3; public: Almacena(void); ~Almacena(void); void set_faces(std::vector<Rect> faces); void set_eyes_r(std::vector<Rect> eyes_r); void set_eyes_l(std::vector<Rect> eyes_l); void set_noses(std::vector<Rect> noses); void set_mouths(std::vector<Rect> mouths); void set_P0(Point2f aux); void set_P1(Point2f aux1); void set_P2(Point2f aux2); void set_P3(Point2f aux3); std::vector<Rect> get_faces(); std::vector<Rect> get_eyes_r(); std::vector<Rect> get_eyes_l(); std::vector<Rect> get_noses(); std::vector<Rect> get_mouths(); Point2f get_P0(); Point2f get_P1(); Point2f get_P2(); Point2f get_P3(); }; #pragma一次 #包括 #包括 #包括 #包括 #包括 使用名称空间std; 使用名称空间cv; 阿拉木图班 { 私人: std::向量myfaces; std::向量myyes\u r; std::向量myeyes\u l; std::媒介mynoses; std::媒介Mymouts; 点2f-P0; 点2f P1; 点2f P2; 点2f-P3; 公众: 阿拉木图(作废); ~Almacena(无效); void set_面(标准::向量面); 无效集(标准::向量眼); 无效集(标准::向量眼); 无效集_鼻(标准::向量鼻); 空集嘴(标准:向量嘴); 无效集_P0(点2f辅助); 无效集_P1(点2f aux1); 空集_P2(点2f aux2); 无效集_P3(点2f aux3); std::vector get_faces(); std::vector get_eyes_r(); std::vector get_eyes_l(); std::vector get_noses(); std::vector get_mouts(); 点2f get_P0(); 点2f get_P1(); 点2f get_P2(); 点2f get_P3(); };

Android 创建一个c+的元素+;JNI中的类 < >我想创建一个自己的C++类元素。 我的JNI功能: JNIEXPORT void JNICALL Java_com_example_telo3_Process_inicializar_1nativo (JNIEnv *, jobject){ Almacena almacena; } 和Almacena是C++类: #pragma once #include <opencv2/objdetect/objdetect.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <iostream> #include <stdio.h> using namespace std; using namespace cv; class Almacena { private: std::vector<Rect> myfaces; std::vector<Rect> myeyes_r; std::vector<Rect> myeyes_l; std::vector<Rect> mynoses; std::vector<Rect> mymouths; Point2f P0; Point2f P1; Point2f P2; Point2f P3; public: Almacena(void); ~Almacena(void); void set_faces(std::vector<Rect> faces); void set_eyes_r(std::vector<Rect> eyes_r); void set_eyes_l(std::vector<Rect> eyes_l); void set_noses(std::vector<Rect> noses); void set_mouths(std::vector<Rect> mouths); void set_P0(Point2f aux); void set_P1(Point2f aux1); void set_P2(Point2f aux2); void set_P3(Point2f aux3); std::vector<Rect> get_faces(); std::vector<Rect> get_eyes_r(); std::vector<Rect> get_eyes_l(); std::vector<Rect> get_noses(); std::vector<Rect> get_mouths(); Point2f get_P0(); Point2f get_P1(); Point2f get_P2(); Point2f get_P3(); }; #pragma一次 #包括 #包括 #包括 #包括 #包括 使用名称空间std; 使用名称空间cv; 阿拉木图班 { 私人: std::向量myfaces; std::向量myyes\u r; std::向量myeyes\u l; std::媒介mynoses; std::媒介Mymouts; 点2f-P0; 点2f P1; 点2f P2; 点2f-P3; 公众: 阿拉木图(作废); ~Almacena(无效); void set_面(标准::向量面); 无效集(标准::向量眼); 无效集(标准::向量眼); 无效集_鼻(标准::向量鼻); 空集嘴(标准:向量嘴); 无效集_P0(点2f辅助); 无效集_P1(点2f aux1); 空集_P2(点2f aux2); 无效集_P3(点2f aux3); std::vector get_faces(); std::vector get_eyes_r(); std::vector get_eyes_l(); std::vector get_noses(); std::vector get_mouts(); 点2f get_P0(); 点2f get_P1(); 点2f get_P2(); 点2f get_P3(); };,android,c++,eclipse,java-native-interface,Android,C++,Eclipse,Java Native Interface,我该怎么办?因为如果我确实喜欢我的代码,会出现以下错误: 对“Almacena::~Almacena()”的未定义引用telo3第41行,外部位置:C:\Users\telo\Desktop\ANDROID\ANDROID-ndk-r8d\toolschains\arm-linux-androideabi-4.6\prebuild\windows\arm-linux-androideabi\bin\ld.exe:.\obj\local\armeabi\objs\nativo\nativo.o:函

我该怎么办?因为如果我确实喜欢我的代码,会出现以下错误:

对“Almacena::~Almacena()”的未定义引用telo3第41行,外部位置:C:\Users\telo\Desktop\ANDROID\ANDROID-ndk-r8d\toolschains\arm-linux-androideabi-4.6\prebuild\windows\arm-linux-androideabi\bin\ld.exe:.\obj\local\armeabi\objs\nativo\nativo.o:函数中的Java\u com\u示例\u telo3\u进程\u inicializar\u 1nativo:jni\nativo.cpc++问题


未定义对'Almacena::Almacena()'的引用,请参见第41行,外部位置:C:\Users\telo\Desktop\ANDROID\ANDROID-ndk-r8d\toolschains\arm-linux-androideabi-4.6\prebuild\windows\arm-linux-androideabi\bin\ld.exe:。\obj\local\armeabi\objs\nativo\nativo.o:函数中的Java\u com\u示例\u telo3\u进程中的nativo:jni\nativo.cpp++问题

LOCAL_SRC_FILES := nativo.cpp \
   Almacena.cpp \
   ... all other cpp files