2012-02-10 35 views
2

在上述情况下,我收到以下编译错误。有人能告诉我为什么吗?我使用下面的文档作为我的引导线Qt编译错误时使用tslib与angstrom g ++

http://billforums.station51.net/viewtopic.php?f=8&t=15

ts_test.o: In function `main': 
ts_test.c:(.text+0x1d8): undefined reference to `rpl_malloc' 
fbutils.o: In function `open_framebuffer': 
fbutils.c:(.text+0xa7c): undefined reference to `rpl_malloc' 
collect2: ld returned 1 exit status 
make[2]: *** [ts_test] Error 1 
ts_harvest.o: In function `main': 
ts_harvest.c:(.text+0x5d0): undefined reference to `rpl_malloc' 
fbutils.o: In function `open_framebuffer': 
fbutils.c:(.text+0xa7c): undefined reference to `rpl_malloc' 
collect2: ld returned 1 exit status 
make[2]: *** [ts_harvest] Error 1 
make[2]: Leaving directory `/home/thwijeth/Downloads/tslib-1.0/tests' 
make[1]: *** [all-recursive] Error 1 
make[1]: Leaving directory `/home/thwijeth/Downloads/tslib-1.0' 
make: *** [all] Error 2 
ts_test.o: In function `main': 
ts_test.c:(.text+0x1d8): undefined reference to `rpl_malloc' 
fbutils.o: In function `open_framebuffer': 
fbutils.c:(.text+0xa7c): undefined reference to `rpl_malloc' 
collect2: ld returned 1 exit status 
make[2]: *** [ts_test] Error 1 
ts_harvest.o: In function `main': 
ts_harvest.c:(.text+0x5d0): undefined reference to `rpl_malloc' 
fbutils.o: In function `open_framebuffer': 
fbutils.c:(.text+0xa7c): undefined reference to `rpl_malloc' 
collect2: ld returned 1 exit status 
make[2]: *** [ts_harvest] Error 1 
make[2]: Leaving directory `/home/thwijeth/Downloads/tslib-1.0/tests' 
make[1]: *** [all-recursive] Error 1 
make[1]: Leaving directory `/home/thwijeth/Downloads/tslib-1.0' 
make: *** [all] Error 2 

回答

5

一个simple Google search on "rpl_malloc"发现这个问题多次提到,与解决方案的建议。问题在于Autoconf配置脚本出于某种原因难以找到malloc,并试图回退到rpl_malloc。有一对夫妇的建议,以解决此问题:

1)定义ac_cv_func_malloc_0_nonnull=yes环境变量,您可以通过运行configure(假设一个bash shell中运行configure之前,例如)为:

ac_cv_func_malloc_0_nonnull=yes ./configure <your configure options> 

2.)手动更改配置脚本,将rpl_malloc problem AC_FUNC_MALLOC行注释为#的前缀。

(参考:this blog post, among others

+0

你是一个生命的救星。它解决了我的问题。 – Tharanga 2012-02-13 08:42:28