Ronny
Ronny

Reputation: 474

Compiling x64 with Rust on Windows

I am trying to compile x64 on Windows with Rust.

I have set: rustup default stable-x86_64-pc-windows-msvc

With the following program

fn main() { println!("{}", std::usize::MAX); }

cargo run prints out 4294967295

but cargo run --target --target x86_64-pc-windows-msvc gives me:

error[E0463]: can't find crate for 'std'
  |
  = note: the 'x86_64-pc-windows-msvc' target may not be installed

Also x86_64-pc-windows-msvc is in rustc --print target-list

I have no idea what to do...

Upvotes: 2

Views: 3555

Answers (2)

Musharraf
Musharraf

Reputation: 61

The answer is in the note section of the error message:

   = note: the 'x86_64-pc-windows-msvc' target may not be installed

To f

Upvotes: -1

Ronny
Ronny

Reputation: 474

This was fixed by uninstalling a rust nightly build found using rustc --print sysroot and reinstalling latest stable build.

Upvotes: 4

Related Questions