c++ - Error "'JNIEXPORT' does not name a type" while trying to compile for Android -


I am trying to compile the C ++ code with NDK to use on Android. However, I get this error when trying to compile:

  Error: 'JNI Airport' is not a type of name (file: JNIPI, Line: 9) Error: 'JNIXport' The name does not have a type (file: JNIApi.h, line: 10)  

JNIApi.h looks like this:

  #pragma once Extern "C" {JNIEXPORT ZERO JNICALL Java_com_manabreak_tremortest_TremorLauncher_initTremor (JNIEnv * jenv, Job topic obj); JNIEXPORT ZERO JNICLL JAVA_COM_ManBreak_TRITTET__TORREAZER LAUNCHER_SATFORMS (JNIAN * JNU, JOBCAD OBJE, JAJJEET SUFAL); }  

and the build process outputs it:

  start building 1.8.2014 11:14:17. 1 & gt; Project "E: \ Trammer \ Build \ Tremor. Vcxproj" on node 2 (create target) 1> ClCompile:. E: \ ADT \ NDK \ toolchains \ hand-linux-androideabi-4.8 \ prebuilt \ windows-x86_64 \ bin \ hand-linux-androideabi- G ++ exe JNIApi.cpp E: \ ADT \ NDK \ toolchains \ Hand-linux-androideabi-4.8 \ Pre-made \ windows-x86_64 \ bin \ hand- linux-androideabi-G ++ exe -o Android / debug / JNIApi.o -marm -fno- strict aliasing -funswitch- loop -finline limit = 100 -fomit frame-pointer -fno- exception -fpic -fstack- defender -fno-RTTI -fno- short enums -xc ++ -Wno-psabi -ie: / ADT / NDK / platforms / android -19 / arc -arm / usr / include -ie: / ADT / NDK / sources / CXX-STL / gnu-libstdc ++ / 4.8 / Include -i: / ADT / NDK / sources / CXX-STL / gnu-libstdc ++ / 4.8 / libs / armeabi -v7a / include -DANDROID_NDK -DANDROID -D__ANDROID__ -D__ARM_EABI__ -D__ARM_ARCH_7__ -D__ARM_ARCH_7A__ -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ - D__ARM_ARCH_5TE__ -O0 -g- Study = C ++ 11 -march = armv7-a -mtune = xscale -c -md ./src/platforms/android/JNIApi.cpp TRApplicationContext.cpp e: \ ADT \ NDK \ toolc Hains \ hand- linux-androideabi-4.8 \ Pre-made \ windows-x86_64 \ bin \ hand- linux -androideabi- G ++ exe -o Android / debug / TRApplicationContext.o -marm -fno- strict aliasing -funswitch- loop -finline limit = 100 -fomit frame-pointer -fno- exception -fpic -fstack- protector - Fno- rtti -fno-short-enums -xc ++ -Wno-psabi-IE: / ADT / Andike / platform / Android -19 / Arch-hand / usr / include-IE / ADT / Andike / source / CX-STL / gnu-libstdc ++ / 4.8 / include- IE / ADT / Andike / source / CX-STL / GNU-Libstdisi ++ / 4.8 / lib / Armebi-V 7 A / in-Diaddroid_anandike -diadroid D-Deediaraidi_- D__RM_EAB_Arch_7___D__RM___________D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -O0g -std = c ++ March 11 = ARMv7-one -c -MD ../src/platforms/android/TRApplicationContext.cpp e -mtune = X scale : \ Vibrate SRC platforms \ Android \ TRApplicationContext.cpp (3): 0: This header contains 1 & gt; E: \ vibration \ src \ platform \ Android \ JNIApikh (9,2): error: 'JNIEXPORT' a type JNIEXPORT does not void name Jeanaisielel Jawa_kom_manbrek_tarmostest_tamre Lonr_inittreror (Jeanaiaanv * Jenv, Jobked Obije); ^ 1 & gt; E: \ vibration \ src \ platform \ Android \ JNIApi.h (10,2): error: 'JNIEXPORT' is a type JNIEXPORT does not name zero JNICALL Java_com_manabreak_tremortest_TremorLauncher_setSurface (JNIEnv * jenv, jobject obj, jobject surface); ^ 1 & gt; Rich Building Project "E: \ Tramer \ Build \ Tremor.wecexpru" (Target Create Goal) - Failed Failure Build Time has passed 00: 00: 00.52  

You must include the JNI header file :

  #include & lt; Jni.h & gt;  

This will define macros JNIEXPORT and JNICALL , do not mention all other types, etc. which are required for JNI .


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -