title: Error "'JNIEXPORT' does not name a type" while trying to compile for Android
body: <p>I'm trying to compile C++ code with NDK to use on Android. However, I get this error when trying to compile:</p>
  
  <pre><code>error: 'JNIEXPORT' does not name a type (File: JNIApi.h, line: 9)
  error: 'JNIEXPORT' does not name a type (File: JNIApi.h, line: 10)
  </code></pre>
  
  <p>JNIApi.h looks like this:</p>
  
  <pre><code>#pragma once
  
  extern "C"
  {
      JNIEXPORT void JNICALL Java_com_manabreak_tremortest_TremorLauncher_initTremor(JNIEnv* jenv, jobject obj);
      JNIEXPORT void JNICALL Java_com_manabreak_tremortest_TremorLauncher_setSurface(JNIEnv* jenv, jobject obj, jobject surface);
  }
  </code></pre>
  
  <p>And the build process outputs this:</p>
  
  <pre><code>Build started 1.8.2014 11:14:17.
     1&gt;Project "E:\Tremor\build\Tremor.vcxproj" on node 2 (Build target(s)).
     1&gt;ClCompile:
         E:\ADT\ndk\toolchains\arm-linux-androideabi-4.8\prebuilt\windows-x86_64\bin\arm-linux-androideabi-g++.exe JNIApi.cpp
         E:\ADT\ndk\toolchains\arm-linux-androideabi-4.8\prebuilt\windows-x86_64\bin\arm-linux-androideabi-g++.exe -o Android/Debug/JNIApi.o -marm -fno-strict-aliasing -funswitch-loops -finline-limit=100 -fomit-frame-pointer -fno-exceptions -fpic -fstack-protector -fno-rtti -fno-short-enums -x c++ -Wno-psabi -IE:/ADT/ndk/platforms/android-19/arch-arm/usr/include -IE:/ADT/ndk/sources/cxx-stl/gnu-libstdc++/4.8/include -IE:/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 -std=c++11 -march=armv7-a -mtune=xscale -c -MD ../src/platforms/android/JNIApi.cpp
       TRApplicationContext.cpp
       E:\ADT\ndk\toolchains\arm-linux-androideabi-4.8\prebuilt\windows-x86_64\bin\arm-linux-androideabi-g++.exe -o Android/Debug/TRApplicationContext.o -marm -fno-strict-aliasing -funswitch-loops -finline-limit=100 -fomit-frame-pointer -fno-exceptions -fpic -fstack-protector -fno-rtti -fno-short-enums -x c++ -Wno-psabi -IE:/ADT/ndk/platforms/android-19/arch-arm/usr/include -IE:/ADT/ndk/sources/cxx-stl/gnu-libstdc++/4.8/include -IE:/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 -std=c++11 -march=armv7-a -mtune=xscale -c -MD ../src/platforms/android/TRApplicationContext.cpp
       E:\Tremor\src\platforms\android\TRApplicationContext.cpp(3): includes this header: 0:
     1&gt;E:\Tremor\src\platforms\android\JNIApi.h(9,2): error : 'JNIEXPORT' does not name a type
         JNIEXPORT void JNICALL Java_com_manabreak_tremortest_TremorLauncher_initTremor(JNIEnv* jenv, jobject obj);
         ^
     1&gt;E:\Tremor\src\platforms\android\JNIApi.h(10,2): error : 'JNIEXPORT' does not name a type
         JNIEXPORT void JNICALL Java_com_manabreak_tremortest_TremorLauncher_setSurface(JNIEnv* jenv, jobject obj, jobject surface);
         ^
     1&gt;Done Building Project "E:\Tremor\build\Tremor.vcxproj" (Build target(s)) -- FAILED.
  
  Build FAILED.
  
  Time Elapsed 00:00:00.52
  </code></pre>