真是醉了,编译横版竖版时用到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)