arm-linux下交叉编译json-c-0.9库遇到的编译问题
时间:11-11
来源:互联网
点击:
在linux下比较成熟的json库要属json-c-0.9. 但是悲剧的是好多人编译不通过。
编译json-c arm版本 貌似可以顺利通过, 但是链接json-c动态库的时候会有提示: undefined reference to rpl_malloc
[我的环境]
虚拟机:vmware 7.1.3
操作系统:ubuntu8.04
arm-linux-gcc版本: 4.2.2
[解决方案]
config.h.in里定义了
#undef malloc
#undef realloc
用//把这两行注释掉,
然后
autoconf
./configure --prefix=/usr/local/json-c-0.9forarm --host=arm-linux 这样可自动调用arm-linux-gcc, 安装在/usr/local/json-c-0.9forarm 下,不要按默认的在/usr/local/lib下,和宿主机混了。
make && make install
这样就OK了。 至于为什么只生成了.a没有生成了.so,不管它了,能用已经万幸了。
最后,别忘了在编译时 -L/usr/local/json-c-0.9forarm/lib/ 指定lib路径。
arm-linux交叉编译编译问 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)