红联Linux门户
Linux帮助

gcc 使用问题求助:"incompatible with i386:x86-64 output"

发布时间:2008-09-18 09:00:56来源:红联作者:zhjguan
我练习使用静态库编程时,按书上内容输入:

"gcc -o usehello_static usehello.c libhello.a"

结果提示:

"/usr/bin/ld: i386 architecture of input file `libhello.a(libhello.o)' is incompatible with i386:x86-64 output
collect2: ld 返回 1"

没有生成执行文件,该怎么解决?(5ty(




------------------------


我是在vmware中装的ubuntu7.10 for amd64。 另外,使用的库文件和c源文件都来自此书的附赠光盘。


我的CPU是:AMD Athlon(tm) 64*2 Dual Core Processor 4200+ 2.20GHz

gcc版本4.1.3

gcc 的 manual 有几百页,也不知道往哪里找参考。
文章评论

共有 2 条评论

  1. rtl 于 2008-09-18 09:58:57发表:

    gcc -m32 -o usehello_static usehello.c libhello.a

  2. satisfy 于 2008-09-18 09:56:22发表:

    建议安装i386的