c语言文件不兼容,c)出错和链接问题:i386:x86-64输入文件架构,与i386输出不兼容...

在尝试使用`make`命令时,遇到了`i386:x86-64`输入文件架构与目标输出不兼容的链接错误。这个问题出现在尝试将32位对象文件与64位编译目标链接时。解决方案可能涉及重新配置编译器以匹配正确的架构或确保所有依赖项都是相同架构的。附带的makefile展示了每个测试用例的编译规则。
摘要由CSDN通过智能技术生成

当我在终端中输入“make”时,我有错误信息输出!

gcc test1.o dispatchQueue.o -o test1 -pthread

/usr/bin/ld: i386:x86-64 architecture of input file `test1.o' is incompatible with i386 output

/usr/bin/ld: final link failed: Invalid operation

collect2: ld returned 1 exit status

make: *** [test1] Error 1有没有人可以解释为什么以及如何解决它? :(

为了以防万一,我附加了makefile

# Comment out the targets you don't want.

# Runs all of the tests.

all: test1 test2 test3 test4 test5 testFor

./test1

./test2

./test3

./test4

./test5

./testFor

test1: test1.o dispatchQueue.o

gcc test1.o dispatchQueue.o -o test1 -pthread

test1.o: test1.c

gcc -c test1.c

test2: test2.o dispatchQueue.o

gcc test2.o dispatchQueue.o -o test2 -pthread

test2.o: test2.c

gcc -c test2.c

test3: tes

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值