iPhone-设备-链接器错误 [英] Iphone - device - linker error
问题描述
我已将libpng添加到我的应用程序中.如果我为模拟器构建,一切正常.当我为设备构建应用程序时,出现链接器错误:
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)
我已经从源代码手动构建了libpng,对于模拟器和设备也是如此(仅在更改了编译目标的情况下).我试图找到此问题,但似乎没有人发布有关此问题的任何信息.
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.
推荐答案
我通过替换libpng
的pngpriv.h
中的第117-121行来解决"此问题:
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
作者
#define PNG_ARM_NEON_OPT 0
这将禁用ARM的NEON优化,这似乎是问题的原因.
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.
这篇关于iPhone-设备-链接器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!