4

私は初心者で、Raspberry Pi に取り組んでいます。GLIB 2.33.10 クロス コンパイルに問題があります。サイトとすべての依存関係 (zlib、ffi) からソースをダウンロードしました。依存関係は ARM 用にビルドされています (Raspberry でテスト済み)。現在、arm-bcm2708hardfp-linux-gnueabi ツールチェーンを使用しています。

私の構成コマンドラインは次のとおりです。

$ ZLIB_CFLAGS=-I/home/myuser/cross_lib/include/libzlib \
ZLIB_LIBS="-L/home/myuser/cross_lib/lib/libzlib/raspberry -lz" \
LDFLAGS="-L/home/myuser/cross_lib/libffi/lib -lffi -L/home/myuser/cross_lib/lib/libzlib/raspberry -lz" 
LIBFFI_CFLAGS=-I/home/myuser/cross_lib/libffi/lib/libffi-3.0.11/include \
LIBFFI_LIBS="-L/home/myuser/cross_lib/libffi/lib -lffi" \
./configure --host=arm-bcm2708hardfp-linux-gnueabi glib_cv_stack_grows=yes \
glib_cv_uscore=yes ac_cv_func_posix_getpwuid_r=no \
ac_cv_func_posix_getgrgid_r=no --with-libiconv=no --without-pcre \
--enable-gtk-doc-html=no --enable-xattr=no --prefix=/home/cross_lib/glib23

ご覧のとおり、iconv と pcre を無効にしました (これはテスト ビルドのみです)。configureスクリプトは問題ありません(問題ないようです...)。ビルドプロセスを開始すると、しばらくの間 (大量のコードをコンパイルする) 続き、リンク段階でスタックします:

/opt/tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/bin/../lib/gcc/arm-bcm2708hardfp-linux gnueabi/4.7.1/../../../../arm-bcm2708hardfp-linux-gnueabi/bin/ld: warning: libgthread-2.0.so.0, needed by ../gobject/.libs/libgobject-2.0.so, not found (try using -rpath or -rpath-link)
/opt/tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/bin/../lib/gcc/arm-bcm2708hardfp-linux-gnueabi/4.7.1/../../../../arm-bcm2708hardfp-linux-gnueabi/bin/ld: warning: libgmodule-2.0.so.0, needed by ./.libs/libgio-2.0.so, not found (try using -rpath or -rpath-link)
./.libs/libgio-2.0.so: undefined reference to `g_module_close'
./.libs/libgio-2.0.so: undefined reference to `g_module_symbol'
./.libs/libgio-2.0.so: undefined reference to `g_module_supported'
./.libs/libgio-2.0.so: undefined reference to `g_module_open'
./.libs/libgio-2.0.so: undefined reference to `g_module_error'
collect2: error: ld returned 1 exit status
make[4]: *** [glib-compile-resources] Errore 1
make[4]: uscita dalla directory "/home/myuser/cross_lib/source/glib-2.33.10/gio"
make[3]: *** [all-recursive] Errore 1
make[3]: uscita dalla directory "/home/myuser/cross_lib/source/glib-2.33.10/gio"
make[2]: *** [all] Errore 2
make[2]: uscita dalla directory "/home/myuser/cross_lib/source/glib-2.33.10/gio"
make[1]: *** [all-recursive] Errore 1
make[1]: uscita dalla directory "/home/myuser/cross_lib/source/glib-2.33.10"
make: *** [all] Errore 2

私には奇妙なエラーのように見えますが、独自のライブラリが見つかりません...しかし、私は専門家ではありません...誰かが私を助けることができますか? アドバイスに感謝し、私の悪い英語を許してください

4

3 に答える 3

2

-lgmodule-2.0最後にLDFLAGSを追加するだけです

于 2015-04-20T10:34:57.710 に答える
1

これはglib 2.36.4でうまくいきました:

$ make LDFLAGS="-rpath $PWD/gmodule/.libs"
于 2013-08-28T20:08:17.783 に答える