Link error cannot open input file 'm.lib'

I'm trying to build an existing rust program, and am running into a link error that I don't know how to fix.

\sadmc-a69c735667542837.exe" "/OPT:REF,NOICF" "/DEBUG" "/NATVIS:C:\\Users\\smay9\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\intrinsic.natvis" "/NATVIS:C:\\Users\\smay9\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\liballoc.natvis" "/NATVIS:C:\\Users\\smay9\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\libcore.natvis" "/NATVIS:C:\\Users\\smay9\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\etc\\libstd.natvis"
  = note: LINK : fatal error LNK1181: cannot open input file 'm.lib'

Presumably it is a problem with my Microsoft C++ Build Tools installation? cargo check works just fine, but cargo build fails.

Any suggestions on how to fix this? Thanks!

1 Like

The issue seems to have been resolved by changing compilers, from msvc to gnu using:

$ rustup default stable-x86_64-pc-windows-gnu

Here's the response to a similar question in a stackoverflow thread that set me in the right direction.

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.