rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
96.71k stars 12.5k forks source link

An error "linking with `link.exe` failed: exit code: 1104" #108525

Closed MuXingchui closed 1 year ago

MuXingchui commented 1 year ago

I got an error: "linking with link.exe failed: exit code: 1104", when I compile the program with VSCode. My program is Python, and I used OpEn to solve the NLP. The OpEn-Optimization builds on 'Rust'. So when I build the optimization solver, I got the error:

error: linking with `link.exe` failed: exit code: 1104

note: Non-UTF-8 output: LINK : fatal error LNK1104: cannot open file “D:\***\mpc-trajectory-generator-master\mpc_build\mpc_navigation\tcp_iface_mpc_navigation\target\release\build\num-traits-abea29fdb848ac61\build_script_build-abea29fdb848ac61.exe”

Besides, my environment:

Python: 3.7.16
OpenGen: 0.6.4
Rustc: 1.67.1 (d5a82bbd2 2023-02-07)
cargo: 1.67.1 (8ecd4f20a 2023-01-10)

I don't know what's wrong, please help me

ChrisDenton commented 1 year ago

LNK1104 means a file cannot be read or written to. I don't know enough about OpenGen to say why that is. I think you'll need to ask OpenGen.

MuXingchui commented 1 year ago

LNK1104 means a file cannot be read or written to. I don't know enough about OpenGen to say why that is. I think you'll need to ask OpenGen.

Thank you for your suggestion

T-O-R-U-S commented 1 year ago

For anyone viewing this in the future, it might be your antivirus.

dorklord23 commented 1 year ago

For anyone viewing this in the future, it might be your antivirus.

Indeed it is. I use Avast and only after I disabled all the real time shields that I manage to compile the app.

ChrisDenton commented 1 year ago

Thanks for the reports. It sounds like this is entirely outside of Rust's control so there's nothing to track in this issue. Unless anyone has any ideas.

ChrisDenton commented 1 year ago

Closing this as per above. But feel free to continue discussing this if anyone has anything to add.

Jasonsey commented 8 months ago

try this solution, it works for me

Young-Lord commented 7 months ago

Try cargo clean and see if any error showed. For me, it was because the task is still running when cargo build was executed. Restart VSCode works for me.