我使用configure, make, make install
. 我的电脑是
[esolve@kitty esolve]$ uname -r
3.6.10-2.fc16.x86_64
我写了一个使用 libevent 的程序。由于我想将此程序分发到许多未安装 libevent 的远程主机。所以我想静态编译程序,使用
gcc -o myprogram mypro.c /usr/local/lib/libevent.a -lpcap -lrt
现在我注意到一些远程机器是 32 位的,而不是 64 位的
所以我想用来-m32
编译
gcc -m32 -o myprogram mypro.c /usr/local/lib/libevent.a -lpcap -lrt
但我得到了错误:
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/local/lib/libevent.a(event.o)' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/local/lib/libevent.a(log.o)' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/local/lib/libevent.a(evutil.o)' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/local/lib/libevent.a(select.o)' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/local/lib/libevent.a(poll.o)' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/local/lib/libevent.a(epoll.o)' is incompatible with i386 output
/usr/bin/ld: i386:x86-64 architecture of input file `/usr/local/lib/libevent.a(signal.o)' is incompatible with i386 output
collect2: ld returned 1 exit status
有什么解决方法吗?谢谢!