真是醉了适秩,編譯橫版豎版時用到AAsset時不出錯绊序,但是單獨寫文件時直接引用幾個頭文件就是報錯,找各種原因也不知道是怎么回事秽荞,還是Google吧骤公。。扬跋。阶捆。原來需要包含<sys/types.h>
之所以在gl_code.cpp中沒有報錯是因為引用了<stdio.h>與<stdlib.h>其中后面的stdlib.h中引用了頭文件<sys/types.h>。钦听。洒试,ndk寫mk真是麻煩。
10:54:02 **** Incremental Build of configuration Default for project MyRealTimeImageProcessing ****
"E:\\3DVR-Project\\android-ndk-r12b\\ndk-build.cmd" all
Android NDK: WARNING: APP_PLATFORM android-23 is larger than android:minSdkVersion 8 in ./AndroidManifest.xml
[armeabi-v7a] Compile++ thumb: ImageProcessing <= RenderModel.cpp
In file included from jni/FaceU/RenderModel.h:12:0,
from jni/FaceU/RenderModel.cpp:3:
jni/FaceU/android-includes/6.0.0_r1/frameworks/native/include/android/asset_manager.h:132:1: error: 'off_t' does not name a type
off_t AAsset_seek(AAsset* asset, off_t offset, int whence);
^
jni/FaceU/android-includes/6.0.0_r1/frameworks/native/include/android/asset_manager.h:143:1: error: 'off64_t' does not name a type
off64_t AAsset_seek64(AAsset* asset, off64_t offset, int whence);
^
jni/FaceU/android-includes/6.0.0_r1/frameworks/native/include/android/asset_manager.h:160:1: error: 'off_t' does not name a type
off_t AAsset_getLength(AAsset* asset);
^
jni/FaceU/android-includes/6.0.0_r1/frameworks/native/include/android/asset_manager.h:166:1: error: 'off64_t' does not name a type
off64_t AAsset_getLength64(AAsset* asset);
^
jni/FaceU/android-includes/6.0.0_r1/frameworks/native/include/android/asset_manager.h:171:1: error: 'off_t' does not name a type
off_t AAsset_getRemainingLength(AAsset* asset);
^
jni/FaceU/android-includes/6.0.0_r1/frameworks/native/include/android/asset_manager.h:178:1: error: 'off64_t' does not name a type
off64_t AAsset_getRemainingLength64(AAsset* asset);
^
jni/FaceU/android-includes/6.0.0_r1/frameworks/native/include/android/asset_manager.h:188:46: error: 'off_t' has not been declared
int AAsset_openFileDescriptor(AAsset* asset, off_t* outStart, off_t* outLength);
^
jni/FaceU/android-includes/6.0.0_r1/frameworks/native/include/android/asset_manager.h:188:63: error: 'off_t' has not been declared
int AAsset_openFileDescriptor(AAsset* asset, off_t* outStart, off_t* outLength);
^
jni/FaceU/android-includes/6.0.0_r1/frameworks/native/include/android/asset_manager.h:199:48: error: 'off64_t' has not been declared
int AAsset_openFileDescriptor64(AAsset* asset, off64_t* outStart, off64_t* outLength);
^
jni/FaceU/android-includes/6.0.0_r1/frameworks/native/include/android/asset_manager.h:199:67: error: 'off64_t' has not been declared
int AAsset_openFileDescriptor64(AAsset* asset, off64_t* outStart, off64_t* outLength);
^
jni/FaceU/RenderModel.cpp: In member function 'bool RenderModel::AddShader(GLenum, const char*)':
jni/FaceU/RenderModel.cpp:71:2: error: 'off_t' was not declared in this scope
off_t bufferSize = AAsset_getLength(asset);
^
jni/FaceU/RenderModel.cpp:72:27: error: 'bufferSize' was not declared in this scope
LOGI("file size : %d\n", bufferSize);
^
jni/FaceU/RenderModel.cpp:6:66: note: in definition of macro 'LOGI'
#define? LOGI(...)? __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
^
make: *** [obj/local/armeabi-v7a/objs/ImageProcessing/RenderModel.o] Error 1
10:54:05 Build Finished (took 3s.410ms)