16

コンパイルしようとしているので、次のパスglib-2.32.1にインストールしました。libffi-3.0.1

~/localroot/lib/

ヘッダーファイルは次の場所にあります。

~/localroot/lib/libffi-3.0.11/include/

ただし、構成する場合:

~/tmp/build_alot/glib-2.32.1 $ ./configure --prefix=~/localroot

次のエラーが表示されます。

checking whether to cache iconv descriptors... no
checking for ZLIB... yes
checking for LIBFFI... no
configure: error: Package requirements (libffi >= 3.0.0) were not met:

No package 'libffi' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables LIBFFI_CFLAGS
and LIBFFI_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

glibを正常にコンパイルするためLIBFFI_LIBSに設定する必要がある正しい値は何 ですか?LIBFFI_CFLAGS

ちょっとした追加情報:

libffiをコンパイルすると、次の役立つ情報が得られました。

ライブラリは次の場所にインストールされています:/ home / nahum / localroot / lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
    ----------------------------------------------------------------------
test -z "/home/user/localroot/share/info" || /bin/mkdir -p "/home/user/localroot/share/info"
 /usr/bin/install -c -m 644 ../doc/libffi.info '/home/nahum/localroot/share/info'
 install-info --info-dir='/home/user/localroot/share/info' '/home/user/localroot/share/info/libffi.info'
test -z "/home/user/localroot/lib/pkgconfig" || /bin/mkdir -p "/home/user/localroot/lib/pkgconfig"
 /usr/bin/install -c -m 644 libffi.pc '/home/user/localroot/lib/pkgconfig'
make[3]: Leaving directory `/home/user/tmp/build_alot/libffi-3.0.11/x86_64-unknown-linux-gnu'
make[2]: Leaving directory `/home/user/tmp/build_alot/libffi-3.0.11/x86_64-unknown-linux-gnu'
make[1]: Leaving directory `/home/user/tmp/build_alot/libffi-3.0.11/x86_64-unknown-linux-gnu'

それでも設定PKG_CONFIG_PATHして/home/user/localroot/lib/pkgconfigも成功しません。

4

2 に答える 2

38

悟りへの道...

私はなんとかglibをコンパイルすることができました:

export LIBFFI_CFLAGS=-I/home/user/localroot/lib/libffi-3.0.11/include
export LIBFFI_LIBS="-L/home/user/localroot/lib -lffi"

次に、将来の依存関係がすべて、コンパイル方法に満足しているかどうかを確認する必要があります。

于 2012-09-19T12:21:09.083 に答える
4

-Iとフラグがどこ-Lから来たのか疑問に思っていた私のような人たち-lffi(Oz123の答え)のために、私はそれらが次の場所にあることを知りました:

/home/user/local-software/libffi-3.1/lib/pkgconfig/libffi.pc

ファイルを読み取ると、次のようになります。

...
...
Libs: -L${toolexeclibdir} -lffi
Cflags: -I${includedir}

LibsCflags場所を使用して、LIBFFI_LIBSLIBFFI_CFLAGS変数をそれぞれ設定します。さて、あなたがそれから走れば./configuremake && make install物事はうまくいくはずです(少なくとも彼らは私のためにやった)。

于 2014-09-08T15:22:37.567 に答える