Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/usr/bin/ld: 找不到 /usr/lib32/crt1.o: 没有那个文件或目录 #10

Open
CrazyprogrammerKim opened this issue Oct 23, 2020 · 3 comments

Comments

@CrazyprogrammerKim
Copy link

kim@kim-virtual-machine:~/桌面$ cbc -Wa,"--32" -Wl,"-melf_i386" hello.cb
/usr/bin/ld: 找不到 /usr/lib32/crt1.o: 没有那个文件或目录
/usr/bin/ld: 找不到 /usr/lib32/crti.o: 没有那个文件或目录
/usr/bin/ld: 当搜索用于 /usr/lib/x86_64-linux-gnu/libc.so 时跳过不兼容的 -lc
/usr/bin/ld: 当搜索用于 /usr/lib/x86_64-linux-gnu/libc.a 时跳过不兼容的 -lc
/usr/bin/ld: 找不到 -lc
/usr/bin/ld: 找不到 /usr/lib32/crtn.o: 没有那个文件或目录
cbc: error: /usr/bin/ld failed. (status 1)
cbc: error: compile error

查找了没有crt*文件,出现这样的错误如何解决阿,求帮助,网络上也没有搜索到解决方法

@CrazyprogrammerKim
Copy link
Author

问题已解决!
有需要的朋友可以看一下:
由于是linux新手而且在网上也没找到消息所以我就一步步解决问题:
1.找不到crt文件
/ usr / bin / ld:找到/usr/lib32/crt1.o:没有那个文件或目录
/ usr / bin / ld:找到/usr/lib32/crti.o:没有那个文件或目录
首先通过locate crt1.o找到crt
文件的位置
/usr/lib/x86_64-linux-gnu/crt1.o
cd /usr/lib/x86_64-linux-gnu 后 发现crt文件都在这个目录下,再执行sudo cp /usr/lib/x86_64-linux-gnu/crt /usr/lib32/将需要的crt*文件复制到缺失的lib32中
2.兼容性问题
/ usr / bin / ld:当搜索使用/ usr / lib / x86_64-linux-gnu /libc.so时跳过不兼容的-lc
/ usr / bin / ld:当搜索使用/usr/lib/x86_64-linux-gnu/libc.a时跳过不兼容的-lc
/ usr / bin / ld:找不到-lc
原因:系统缺失32 位的静态库和动态库库文件
执行命令:sudo apt-get install build-essential module-assistant gcc-multilib g++-multilib

综上解决问题。

@Learning356
Copy link

感谢一样的问题已解决

@lknt
Copy link

lknt commented May 16, 2023

6,解决了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants