NDK jni中编译时出现的问题

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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • afinalAfinal是一个android的ioc,orm框架 https://github.com/yangf...
    passiontim阅读 15,760评论 2 45
  • 毕业二十五年,同学们吵着要聚会。当仁不让,自然是我们几个留守在本地的同学张罗着组织。时间略有些匆忙,不过从外地来了...
    70前阅读 1,828评论 0 2
  • 今天正常上课,不过还是按照自己的老套路出发,就是自学。多做点题目就OK了。 今天下午做化学实验做的是一塌糊涂,本来...
    雷帅帅阅读 1,225评论 0 0
  • 水一的春天,杜鹃花开的时候,是考试的季节。 是忙碌的季节,没有人问为什么,就是忙碌的季节,在本将苏醒的日子里。 我...
    爱我别走阅读 2,726评论 0 1

友情链接更多精彩内容