如何在 Ubuntu 上修复 "Cannot find crt1.o"

问题:

你正在 Ubuntu 上编译某些东西(例如使用 GCC),但你收到类似这样的错误消息:

crt1_error.txt
/usr/bin/ld: error: cannot open crt1.o: No such file or directory
/usr/bin/ld: error: cannot open crti.o: No such file or directory
/usr/bin/ld: error: cannot open crtn.o: No such file or directory

解决方案

使用以下命令代替 make

make_with_library_path.sh
LIBRARY_PATH=/usr/lib/x86_64-linux-gnu make

原始来源


Check out similar posts by category: Build Systems, Linux