Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows 10 rustc main.rs #32283

Closed
zanjs opened this issue Mar 16, 2016 · 6 comments
Closed

windows 10 rustc main.rs #32283

zanjs opened this issue Mar 16, 2016 · 6 comments

Comments

@zanjs
Copy link

zanjs commented Mar 16, 2016

main.rs

fn main() { println!("Hello, world!"); }

run

`
F:\coding\rust-lang\test\hello_world>rustc main.rs

error: could not exec the linker link.exe: 系统找不到指定的文件。
`

@Stebalien
Copy link
Contributor

Assuming you're using the MSVC version of rust, you need to install Visual Studio 2013 or later. https://www.rust-lang.org/downloads.html#win-foot

@bombless
Copy link
Contributor

@zanjs 你能说说你的安装包是从哪个地址下载的吗?
我的建议是你装这个版本:
https://static.rust-lang.org/dist/rust-1.7.0-x86_64-pc-windows-gnu.msi (64位操作系统)
https://static.rust-lang.org/dist/rust-1.7.0-i686-pc-windows-gnu.msi (32位操作系统)
如果你需要nightly-build,可以安装
https://static.rust-lang.org/dist/rust-nightly-x86_64-pc-windows-gnu.msi (64位操作系统)
https://static.rust-lang.org/dist/rust-nightly-i686-pc-windows-gnu.msi (32位操作系统)

记得安装时不要去掉安装链接器的勾

你现在用的这个是MSVC版本的,那个链接器是没有随安装包一起分发的,因此就像Stebalien说的,你需要先安装过MSVC。

@zanjs
Copy link
Author

zanjs commented Mar 17, 2016

@zanjs zanjs closed this as completed Mar 17, 2016
@bombless
Copy link
Contributor

I feel that we should modify the installer to make it more clear to the user that they need MSVC to make MSVC version actually work. Thoughts?

@zanjs
Copy link
Author

zanjs commented Mar 18, 2016

@bombless 我电脑安装了 vs 2015 的 ,还需要装什么,貌似 MSVC的配置环境还不简单呀,果断使用
windows-gnu.msi 啊,希望官方能把配置环境 说的详细点😄,新手好快速入门

@bombless
Copy link
Contributor

@zanjs 是啊,所以那个下载页有说

Rust's support for the GNU ABI is more mature, and is recommended for typical uses.

更推荐GNU ABI而不是MSVC ABI。

我们可爱的WindowsBunny正试图改变这一状况 #31158

我还在看怎么搞比较好,最偷懒的方式是安装包顺便给自己装一个MSVC哈哈哈。

至于要用MSVC版rustc的话,先要把MSVC里的link.exe所在的目录加到系统的PATH环境变量里吧。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants