简体   繁体   English

Windows 上 CLion 的 Rust 标准库位置路径是什么?

[英]What's the path for the Rust standard library location for CLion on Windows?

I am getting started with Rust and I am using the Rust plugin for Clion .我开始使用 Rust,我正在使用Clion 的 Rust 插件 When I create a new Rust project, I need to specify the location of the stdlib.当我创建一个新的 Rust 项目时,我需要指定 stdlib 的位置。 For whatever reason, it's not auto populating with the correct path.无论出于何种原因,它都不会自动填充正确的路径。 When I click Download via rustup nothing happens.当我点击Download via rustup没有任何反应。

What's the path for the Rust standard library? Rust 标准库的路径是什么?

在此处输入图像描述

将标准库路径设为“c:\\Users\\andrew\\.cargo\\registry”。

对于那些遇到挑战的人,这是 Windows 上的位置(假设稳定/x64):

C:\Users\<user>\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src

I use wsl with Windows and the path to the standard Rust libraries is this:我在 Windows 中使用 wsl,标准 Rust 库的路径是这样的:

\\wsl$\kali-linux\home\myUserName\.rustup\toolchains\stable-x86_64-unknown-linux-gnu\lib\rustlib\src\rust

Only to get this I searched because right after installation it didn't work either.只是为了得到这个,我进行了搜索,因为在安装后它也不起作用。

I had to delete all my toolchains directory from wsl with我不得不从 wsl 中删除我所有的工具链目录

rm -frv ~/.rustup/toolchains/* directory 

and then install it again by doing然后重新安装它

rustup update 

and

rustup -v component add rust-src

otherwise I didn't have the standard Rust libraries in my installation and I got a否则我的安装中没有标准的 Rust 库,我得到了一个

/lib/rustlib/src': No such file or directory 

error错误

when testing测试时

ls ~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM