2012-12-29 154 views
2

我想爲我的項目安裝PBC庫。在我的64位系統上,configure腳本很容易安裝64位庫。但是我必須使用的代碼是基於32位的。在64位機器上安裝32位PBC庫

我試過這個命令(從一個答案question):

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

但是當我運行 '讓' 我得到這個錯誤:

/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. 

回答

2

首先,檢查:

./configure --help 

它允許覆蓋CFALGS/LDFLAGS嗎?

如果是,則按照幫助信息進行操作。 其次,通常./configure生成makefile,然後發出「make」命令。 你說,配置後你剛剛得到這個錯誤?

如果您在製作完成後收到這些錯誤,那麼它看起來像ld正在與舊殘留鏈接。

你嘗試:

make clean;make 
+0

對不起,我忘了提及它。我運行'make'時出現上述錯誤。我添加了'--help'的輸出。我是否需要添加cppflags和cpp? – Ajoy

+0

或者你認爲--build = i686-pc-linux-gnu是錯誤的。應該像i386-linux-gnu? – Ajoy

+0

我用CPPFLAGS替換了CXXFLAGS,它工作。謝謝Icarus3 – Ajoy

0

感謝@ Icarus3。你指出我正確的方向。我使用的命令是:

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

當我跑

./configure --help 

它沒有CXXFLAGS。所以我將它改爲CPPFLAGS=-m32。它的工作。

相關問題