Вопрос

I have added libpng to my application. If I build for simulator, everything is OK. When I build application for device, I got linker error:

    Undefined symbols for architecture armv7: "_png_init_filter_functions_neon", referenced from: _png_read_filter_row in libpng-arm7-release.a(pngrutil.o)

I have build libpng manually from source, same way for simulator and device (only with changed target of compilation). I have tried to find this problem, but noone seems to post anything about this problem.

Это было полезно?

Решение

I "solved" this by replacing lines 117-121 in libpng's pngpriv.h:

#  ifdef __ARM_NEON__
#     define PNG_ARM_NEON_OPT 2
#  else
#     define PNG_ARM_NEON_OPT 0
#  endif

by

#define PNG_ARM_NEON_OPT 0

This disables ARM's NEON optimizations, which seems to be the cause of the problem.

This is merely a workaround though, I didn't have time to investigate the real cause of the problem further.

Другие советы

Adding to PSyton's comment, here is how we solved it. Compile the arm/*.c files. This however does only work for Android. For iOS, we additionally had to create a new pnglibconf.h with the entries:

#undef PNG_ARM_NEON_API_SUPPORTED
#undef PNG_ARM_NEON_CHECK_SUPPORTED
#define PNG_ARM_NEON_OPT 0

Looking at the ARM defines in libpng, it seems like they are a bit buggy currently, as PNG_ARM_NEON_API_SUPPORTED should be sufficient to turn NEON compilation off.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top