mupdf for android: ndk-build problem (error: redefinition of typedef…)

匿名 (未验证) 提交于 2019-12-03 01:03:01

问题:

I am following the necessary steps to have MuPDF for Android. MuPDF is built on my system, I am able to exploit it with C++, now trying with Android. All steps in the README successfully followed but when I get to step 10, that is when I have to do ndk-build, I get some errors:

/home/pc/sviluppo/android-ndk-r6b/platforms/android-8/arch-arm/usr/include/stdint.h:53: error: redefinition of typedef 'uint32_t' /home/pc/sviluppo/mupdf-0.9/android/jni/../../thirdparty/jbig2dec/os_types.h:46: note: previous declaration of 'uint32_t' was here make: *** [/home/pc/sviluppo/mupdf-0.9/android/obj/local/armeabi/objs-  debug/mupdfthirdparty/../../thirdparty/jbig2dec/jbig2.o] Errore 1 

What's wrong?

$PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/pc/sviluppo/android-sdk-linux_x86/tools:/home/pc/sviluppo/android-ndk-r6b 

PS: someone add mupdf tag

回答1:

jbig2dec/os_types.h redeclares uint32_t (and the others),

You need to remove them manually.

Then it will work.



回答2:

I have view pager in my application.i need to show pdf files on each fragment in view pager.is there way to get a pdf view from mupdf ? normally we call mupdf as below

Uri uri = Uri.parse("path to pdf file");

Intent intent = new Intent(context, MuPDFActivity.class);

intent.setAction(Intent.ACTION_VIEW);

intent.setData(uri);

context.startActivity(intent);

So if i use mupdf for my app i have to call MuPDFActivity on each fragment.I think its not a correct way?



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!