[问题] ld 指令问题

楼主: SNSDpk5566 (5566 超强)   2015-12-09 19:01:21
请问一下 我在ubuntu 14版 64位元下 想要用ld 连结两个 .o档案
foo.o是C语言 bar.o是组语编出来的 我想要连结两个档案
输入 ld -s -o foobar foo.o bar.o
发生下面的问题
ld: i386 architecture of input file `foo.o' is
incompatible with i386:x86-64 output
爬网络改起来是要改用 elf_i386 于是改为
ld -m elf_i386 -s -o foobar foo.o bar.o
一样还是有相同的问题
但是单独使用
ld -m elf_i386 -o hello hello.o 这样可以
想问一下两个档案要怎么使用ld指令
谢谢
作者: CP64 (( ̄▽ ̄#)﹏﹏)   2015-12-09 21:23:00
http://goo.gl/4uiLaI google "ld asm with c" 就有了
作者: hijkxyzuw (i,j,k) ×(x,y,z)   2015-12-09 22:39:00
?抱歉嘘错篇

Links booklink

Contact Us: admin [ a t ] ucptt.com