码迷,mamicode.com
首页 > 其他好文 > 详细

Installing Rust

时间:2015-01-07 23:35:42      阅读:204      评论:0      收藏:0      [点我收藏+]

标签:

1.官方说明

If you‘re on Linux or a Mac, all you need to do is this (note that you don‘t need to type in the $s, they just indicate the start of each command):

  curl -s https://static.rust-lang.org/rustup.sh | sudo sh

2.我的环境:

  Centos 7.0 64位

  ①执行命令:curl -s https://static.rust-lang.org/rustup.sh | sudo sh

技术分享

 

  ②安装完毕,提示 :

  技术分享

 

 

  ③If you‘ve got Rust installed, you can open up a shell, and type this:

   rustc --version

  报error啦

  ④解决方案:

    a.vim /etc/ld.so.conf

    b.添加一行代码

     /usr/local/lib

    c.以root身份登录执行命令

     ldconfig -v

  ⑤再查看版本

  rustc --version

  技术分享

  OK,到此rust安装成功。

3.编写第一个rust程序并编译执行

  a.vim test.rs 

// test.rs
fn main() {
    println!("Hello, world!");
}

   b. ls 查看文件

     技术分享

  c. 编译

  执行命令:rustc test.rs

    技术分享

  生成一个二进制文件test

  d.执行可执行文件test

    执行命令:./test

  e.运行结果

    技术分享

 

 

 

 

Installing Rust

标签:

原文地址:http://www.cnblogs.com/ifeelo/p/4209632.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!