将一些常见错误记录下来,以便自已查看使用,节省去搜索的时间
1、stlport的问题解决
external/stlport/src/num_put_float.cpp: In function 'bool std::priv::_Stl_is_nan_or_inf(double)':
external/stlport/src/num_put_float.cpp:143: error: 'IsNANorINF' was not declared in this scope
external/stlport/src/num_put_float.cpp: In function 'bool std::priv::_Stl_is_inf(double)':
解决方法:编辑external/stlport/Android.mk修改libstlport_cflags := -D_GNU_SOURCE -DUSE_SPRINTF_INSTEAD
2、bitwise.c的问题解决
In file included from external/tremolo/Tremolo/bitwise.c:43:
external/tremolo/Tremolo/misc.h:82: error: redefinition of 'union magic'
解决方法:
在external/tremolo/Tremolo/misc.h中加入
#include <endian.h>
3、__dso_handle的问题解决
external/stlport/src/monetary.cpp:39: undefined reference to `__dso_handle'
out/target/product/vm/obj/SHARED_LIBRARIES/libstlport_intermediates/src/locale.o: In function `__static_initialization_and_destruction_0':
解决方法:修改external/stlport/dll_main.cpp加入
extern "C" {
void * __dso_handle = 0;
}
4、dnsmasq的dbus引用问题解决
external/dnsmasq/src/dbus.c:21:23: error: dbus/dbus.h: No such file or directory
external/dnsmasq/src/dbus.c:60: error: expected specifier-qualifier-list before 'DBusWatch'
external/dnsmasq/src/dbus.c:65: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'add_watch'
修改external/dnsmasq/src/config.h
/* #define HAVE_DBUS */
#ifdef __ANDROID__
#undef HAVE_DBUS
#endif
5、libnfc-nxp的问题解决
target arm C: libnfc <= external/libnfc-nxp/src/phLibNfc.c
cc1: error: unrecognized command line option "-mapcs"
cc1: error: unrecognized command line option "-mno-sched-prolog"
cc1: error: unrecognized command line option "-mabi=aapcs-linux"
cc1: error: unrecognized command line option "-mno-thumb-interwork"
修改external/libnfc-nxp/Android.mk将
LOCAL_CFLAGS += -DNXP_MESSAGING -DINCLUDE_DALINIT_DEINIT -pipe -fomit-frame-pointer -Wall -Wno-trigraphs -Werror-implicit-function-declaration -fno-strict-aliasing -mapcs -mno-sched-prolog -mabi=aapcs-linux -mno-thumb-interwork -msoft-float -Uarm -fno-common –fpic
改为
LOCAL_CFLAGS += -DNXP_MESSAGING -DINCLUDE_DALINIT_DEINIT -pipe -fomit-frame-pointer -Wall -Wno-trigraphs -Werror-implicit-function-declaration -fno-strict-aliasing -msoft-float -Uarm -fno-common -fpic
6、IAudioEffect.c的问题解决6、
out/target/product/vm/obj/SHARED_LIBRARIES/libOpenSLES_intermediates/IAndroidEffect.o:(.data.rel.ro._ZTIN7android12SortedVectorINS_16key_value_pair_tImPNS_11AudioEffectEEEEE[typeinfo for android::SortedVector<android::key_value_pair_t<unsigned long, android::AudioEffect*> >]+0x0): undefined reference to `vtable for __cxxabiv1::__vmi_class_type_info'
将system/media/opensles/libopensles/IAndroidEffect.c换名IAndroidEffect.cpp并更新Android.mk文件包含的IAudioEffect.c->IAudioEffect.cpp
7、消除LOCAL_MODULE_TAGS的问题(external/grub),
设置LOCAL_MODULE_TAGS := optional
build/core/base_rules.mk:74: *** Module name: grub_stage1
build/core/base_rules.mk:75: *** Makefile location: external/grub
总结的不错,记录在此以便查询,谢谢,作者blog:
http://carltao.blog.51cto.com