如何处理链接器错误:错误 – 找不到-lgcc

前端之家收集整理的这篇文章主要介绍了如何处理链接器错误:错误 – 找不到-lgcc前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
这是我的makefile:
task0 : main.o numbers.o add.o
        gcc -m32 -g -Wall -o task0 main.o numbers.o add.o

main.o : main.c
        gcc -g -Wall -m32 -ansi -c -o main.c
numbers.o : numbers.c
           gcc -g -Wall -m32 -ansi -c -o numbers.c
add.o: add.s
      nasm -g -f elf -w+all -o add.o add.s
clean : 
       rm -f *.o task0

这是终端输出

gcc -m32 -g -Wall -o task0 main.o numbers.o add.o
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.8/libgcc.a when      searching for -lgcc
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.8/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
collect2: error: ld returned 1 exit status
make: *** [task0] 1 הלקת

谁能解释一下lgcc是什么以及如何解决这个问题?

解决方法

(在评论中回答.见 Question with no answers,but issue solved in the comments (or extended in chat))

@Basil Starynkevitch写道:

You should install the gcc-multilib package

@Jekyll写道:

07001

原文链接:https://www.f2er.com/c/119615.html

猜你在找的C&C++相关文章