Closed yomiko451 closed 9 months ago
It can be noted that: warning: unused manifest key: target.x86_64-pc-windows-msvc.rustflags
.
[target.x86_64-pc-windows-msvc]
rustflags = [
"-C", "link-arg=Mfplat.lib",
"-C", "link-arg=Strmiids.lib",
"-C", "link-arg=Mfuuid.lib",
"-C", "link-arg=Bcrypt.lib",
"-C", "link-arg=Secur32.lib",
"-C", "link-arg=Ole32.lib",
"-C", "link-arg=User32.lib"
]
This shouldn't be placed in Cargo.toml
, try move it into <your-project>/.cargo/config.toml
.
Similar issue: https://users.rust-lang.org/t/statically-linking-to-crt-on-msvc/9755
It can be noted that:
warning: unused manifest key: target.x86_64-pc-windows-msvc.rustflags
.[target.x86_64-pc-windows-msvc] rustflags = [ "-C", "link-arg=Mfplat.lib", "-C", "link-arg=Strmiids.lib", "-C", "link-arg=Mfuuid.lib", "-C", "link-arg=Bcrypt.lib", "-C", "link-arg=Secur32.lib", "-C", "link-arg=Ole32.lib", "-C", "link-arg=User32.lib" ]
This shouldn't be placed in
Cargo.toml
, try move it into<your-project>/.cargo/config.toml
.Similar issue: https://users.rust-lang.org/t/statically-linking-to-crt-on-msvc/9755
原来如此,还是学的少了,多谢多谢!
一开始运行示例代码出现链接错误后,我看到issues里也有类似情况,需要在cargo.toml里添加rustflag链接需要的库,但是我按照说明修改后,依然不起作用,还是同样的错误。我试着自己捣鼓了一天还是无果,只能来这里问了,希望大佬能解答一下。
这是我的cargo.toml文件内容:
但是还是出现了链接错误: