title: 奇怪的事... author: lenfrex cover: tags: - 日常 - 玄学 categories: - 折腾 - 日常 date: 2022-03-08 08:54:00 --- 今天用rust编译一个库,因为之前没用过rust,是新装上去的。 我这里的linker指定的是mingw,也就是gcc那一套。 按照文档的说法,`cargo build --release`就好了。 编译的过程中,一开始还很顺利,但是半路就报错: ``` error: linking with `x86_64-w64-mingw32-gcc` failed: exit code: 1 | = note: "x86_64-w64-mingw32-gcc" "-fno-use-linker-plugin" "-Wl,--dynamicbase" "-Wl,--disable-auto-image-base" "-m6... // 有很多路径的输出... = note: collect2.exe: fatal error: CreateProcess: No such file or directory compilation terminated. error: could not compile `crc32fast` due to previous error warning: build failed, waiting for other jobs to finish... error: build failed ``` 行吧,老办法,搜。 好嘛,玄学问题... 原来的系统变量PATH里边mingw的路径为`D:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin` 你猜怎么着? "bin"后边多加个斜杠就好了 ←_← 附:其他人的方法 [gcc: error: CreateProcess: No such file or directory解决方案_肥宅Sean-CSDN博客](https://blog.csdn.net/a19990412/article/details/78360518)