cargo test 报错 STATUS_DLL_NOT_FOUND

windows 下 运行cargo test 报错,如下:

The command "cargo test --all" exited with 127.
    Finished test [unoptimized + debuginfo] target(s) in 25.78s
     Running target\debug\deps\ggwp_zgui-3b74f8e4b6c31eb3.exe
     Running target\debug\deps\ggwp_zscene-ec8c5c465c239831.exe
     Running target\debug\deps\zcomponents-1118c32f12d9d9de.exe
     Running target\debug\deps\zemeroth-87343641e1757a7b.exe
error: test failed, to rerun pass '-p zemeroth --bin zemeroth'
Caused by:
  process didn't exit successfully: `C:\Users\travis\build\ozkriff\zemeroth\target\debug\deps\zemeroth-87343641e1757a7b.exe` (exit code: 0xc0000135, STATUS_DLL_NOT_FOUND)

解决方法:把toolchains 的bin路径添加到环境变量。

执行 rustc --print sysroot 就会输出你toolchains的路径,把类似C:\Users\appveyor\.rustup\toolchains\%RUST_VERSION%-%TARGET%\bin这样的路径添加到环境变量中的PATH中即可。

用VSCODE的同学记得重启下VSCODE,用命令行的重启下命令行。

参考:Weird `cargo test` error on travis windows job - help - The Rust Programming Language Forum

你可能感兴趣的:(rust,rust,开发语言,后端)