小编use*_*040的帖子

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

当我在终端输入"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
Run Code Online (Sandbox Code Playgroud)

有没有人可以解释为什么以及如何解决它?:(

我附加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: …
Run Code Online (Sandbox Code Playgroud)

c compiler-errors makefile linker-errors incompatibletypeerror

23
推荐指数
1
解决办法
7万
查看次数