解决 cannot find crt1.o: No such file or directory

我在交叉编译时遇到了这个问题。排查问题时,在CMakeLists中去掉了这一行之后,问题解决:

set(CMAKE_SYSROOT  ${TOOLCHAIN_DIR})
gcc.exe D:\代码\main.c -o main D:\应用\CLion 2024.1.4\bin\mingw\bin/ld.exe: cannot find D:/应用/CLion 2024.1.4/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/13.1.0/../../../../x86_64-w64-mingw32/lib/../lib/crt2.o: No such file or directory D:\应用\CLion 2024.1.4\bin\mingw\bin/ld.exe: cannot find D:/应用/CLion 2024.1.4/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/13.1.0/crtbegin.o: No such file or directory D:\应用\CLion 2024.1.4\bin\mingw\bin/ld.exe: cannot find -lmingw32: No such file or directory D:\应用\CLion 2024.1.4\bin\mingw\bin/ld.exe: cannot find -lgcc: No such file or directory D:\应用\CLion 2024.1.4\bin\mingw\bin/ld.exe: cannot find -lgcc_eh: No such file or directory D:\应用\CLion 2024.1.4\bin\mingw\bin/ld.exe: cannot find -lmoldname: No such file or directory D:\应用\CLion 2024.1.4\bin\mingw\bin/ld.exe: cannot find -lmingwex: No such file or directory D:\应用\CLion 2024.1.4\bin\mingw\bin/ld.exe: cannot find -lmsvcrt: No such file or directory D:\应用\CLion 2024.1.4\bin\mingw\bin/ld.exe: cannot find -lkernel32: No such file or directory D:\应用\CLion 2024.1.4\bin\mingw\bin/ld.exe: cannot find -lpthread: No such file or directory D:\应用\CLion 2024.1.4\bin\mingw\bin/ld.exe: cannot find -ladvapi32: No such file or directory D:\应用\CLion 2024.1.4\bin\mingw\bin/ld.exe: cannot find -lshell32: No such file or directory D:\应用\CLion 2024.1.4\bin\mingw\bin/ld.exe: cannot find -luser32: No such file or directory D:\应用\CLion 2024.1.4\bin\mingw\bin/ld.exe: cannot find -lkernel32: No such file or directory D:\应用\CLion 2024.1.4\bin\mingw\bin/ld.exe: cannot find -liconv: No such file or directory D:\应用\CLion 2024.1.4\bin\mingw\bin/ld.exe: cannot find -lmingw32: No such file or directory D:\应用\CLion 2024.1.4\bin\mingw\bin/ld.exe: cannot find -lgcc: No such file or directory D:\应用\CLion 2024.1.4\bin\mingw\bin/ld.exe: cannot find -lgcc_eh: No such file or directory D:\应用\CLion 2024.1.4\bin\mingw\bin/ld.exe: cannot find -lmoldname: No such file or directory D:\应用\CLion 2024.1.4\bin\mingw\bin/ld.exe: canno
03-17
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值