Note that there are some explanatory texts on larger screens.

plurals
  1. POCreate an element of a c++ class in JNI
    primarykey
    data
    text
    <p>I want create an element of a own c++ class. My JNI function:</p> <pre><code>JNIEXPORT void JNICALL Java_com_example_telo3_Process_inicializar_1nativo (JNIEnv *, jobject){ Almacena almacena; } </code></pre> <p>And Almacena is a c++ class:</p> <pre><code>#pragma once #include &lt;opencv2/objdetect/objdetect.hpp&gt; #include &lt;opencv2/highgui/highgui.hpp&gt; #include &lt;opencv2/imgproc/imgproc.hpp&gt; #include &lt;iostream&gt; #include &lt;stdio.h&gt; using namespace std; using namespace cv; class Almacena { private: std::vector&lt;Rect&gt; myfaces; std::vector&lt;Rect&gt; myeyes_r; std::vector&lt;Rect&gt; myeyes_l; std::vector&lt;Rect&gt; mynoses; std::vector&lt;Rect&gt; mymouths; Point2f P0; Point2f P1; Point2f P2; Point2f P3; public: Almacena(void); ~Almacena(void); void set_faces(std::vector&lt;Rect&gt; faces); void set_eyes_r(std::vector&lt;Rect&gt; eyes_r); void set_eyes_l(std::vector&lt;Rect&gt; eyes_l); void set_noses(std::vector&lt;Rect&gt; noses); void set_mouths(std::vector&lt;Rect&gt; mouths); void set_P0(Point2f aux); void set_P1(Point2f aux1); void set_P2(Point2f aux2); void set_P3(Point2f aux3); std::vector&lt;Rect&gt; get_faces(); std::vector&lt;Rect&gt; get_eyes_r(); std::vector&lt;Rect&gt; get_eyes_l(); std::vector&lt;Rect&gt; get_noses(); std::vector&lt;Rect&gt; get_mouths(); Point2f get_P0(); Point2f get_P1(); Point2f get_P2(); Point2f get_P3(); }; </code></pre> <p>How Can I do? Because if I do like in my code, appears these errors:</p> <p>undefined reference to 'Almacena::~Almacena()' telo3 line 41, external location: C:\Users\telo\Desktop\ANDROID\android-ndk-r8d\toolchains\arm-linux-androideabi-4.6\prebuilt\windows\arm-linux-androideabi\bin\ld.exe: .\obj\local\armeabi\objs\nativo\nativo.o: in function Java_com_example_telo3_Process_inicializar_1nativo:jni\nativo.cpp C/C++ Problem</p> <p>undefined reference to 'Almacena::Almacena()' telo3 line 41, external location: C:\Users\telo\Desktop\ANDROID\android-ndk-r8d\toolchains\arm-linux-androideabi-4.6\prebuilt\windows\arm-linux-androideabi\bin\ld.exe: .\obj\local\armeabi\objs\nativo\nativo.o: in function Java_com_example_telo3_Process_inicializar_1nativo:jni\nativo.cpp C/C++ Problem</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload