2

プロジェクトにPBCライブラリをインストールしたい。私の64ビットシステムでは、configureスクリプトは64ビットライブラリを簡単にインストールします。しかし、私が使用しなければならないコードは32ビットで構築されています。

私はこのコマンドを試しました(この質問への回答から):

./configure --build=i686-pc-linux-gnu "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32"

しかし、'make'を実行するとこのエラーが発生します:

/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-field.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-z.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-naivefp.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-fastfp.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-fp.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-fasterfp.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-montfp.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-multiz.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-dlog.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-fieldquadratic.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-poly.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-random.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-init_random.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-darray.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-symtab.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-get_time.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-utils.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-memory.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-extend_printf.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-mpc.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-mnt.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-hilbert.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-curve.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-pairing.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-singular.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-param.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-a_param.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-d_param.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-e_param.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-f_param.o' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `.libs/libpbc_la-g_param.o' is incompatible with i386 output

'--help'は、次のフラグを一覧表示します。

Some influential environment variables:
CC          C compiler command
CFLAGS      C compiler flags
LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a nonstandard directory <lib dir>
LIBS        libraries to pass to the linker, e.g. -l<library>
CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir>
CPP         C preprocessor
Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations.
4

2 に答える 2

2

まず、確認してください。

./configure --help

CFALGS / LDFLAGSをオーバーライドできますか?

はいの場合は、ヘルプ情報に従って実行してください。次に、通常、。/ configureはmakefileを生成してから、「make」コマンドを発行します。設定直後にこのエラーが発生したとおっしゃいましたか?

makeの後にこれらのエラーが発生する場合は、ldがold-residueとリンクしているように見えます。

試しましたか:

make clean;make
于 2012-12-29T17:32:48.307 に答える
0

@Icarus3に感謝します。あなたは私を正しい方向に向けました。私が使用したコマンドは次のとおりです。

./configure --build=i686-pc-linux-gnu "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32"

私が走ったとき

./configure --help

ありませんでしたCXXFLAGS。そこで、に変更しましたCPPFLAGS=-m32。そしてそれはうまくいった。

于 2012-12-30T05:26:51.243 に答える