2

上記のシナリオでは、次のコンパイル エラーが発生します。誰かが理由を教えてもらえますか? 次のドキュメントをガイドラインとして使用しています

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
4

1 に答える 1

5

「rpl_malloc」を Google で簡単に検索すると、この問題に関する多くの参照と解決策の提案が見つかります。問題は、Autoconf 構成スクリプトがmalloc何らかの理由で検出に問題があり、 にフォールバックしようとすることrpl_mallocです。これを回避するには、いくつかの提案があります。

1.)ac_cv_func_malloc_0_nonnull=yesを実行する前に環境変数を定義します。configureたとえば、configure を実行して (bash シェルを想定)、次のようにします。

ac_cv_func_malloc_0_nonnull=yes ./configure <your configure options>

また

rpl_malloc problem AC_FUNC_MALLOC2.) configure スクリプトを手動で変更して、行の先頭に . を付けてコメントアウトします#

(参考:このブログ記事など

于 2012-02-11T18:52:00.180 に答える