小编Sha*_*sky的帖子

/usr/bin/ld: 找不到 -lgcc - 程序集链接时出错

我正在尝试在 Linux Mint 17.2 中编译main.c代码和汇编代码pstring.s。

当我尝试链接代码时,gcc返回: /usr/bin/ld: cannot find -lgcc。

有谁知道我需要改变什么才能使其发挥作用?

gcc -m32 -g -c -o pstring.o pstring.s 

shay@shay-Latitude-E6410~/workspace1/targ3Mivne $ gcc -m32 -g -c -o main.o main.c

shay@shay-Latitude-E6410 ~/workspace1/targ3Mivne $ gcc -m32 -g -o a.out main.o pstring.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
Run Code Online (Sandbox Code Playgroud)

c linux assembly gcc

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

标签 统计

assembly ×1

c ×1

gcc ×1

linux ×1