$ file * main: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=989d3d9b6419e9e16be59fe589ddda8c631c30f0, with debug_info, not stripped main.rs: C source, ASCII text
$ ls -alh 합계 12M drwxrwxr-x 2 user user 4.0K 5월 11 10:06 . drwxrwxr-x 24 user user 4.0K 5월 11 10:05 .. -rwxrwxr-x 1 user user 12M 5월 11 10:06 main -rw-rw-r-- 1 user user 148 5월 11 10:06 main.rs
Welcome to an overview of the documentation provided by theRust project. This page contains links to various helpful references, most of which are available offline (if opened withrustup doc).
C:\Users\user\Desktop\study\rust\hello_cargo>cargo build Compiling hello_cargo v0.1.0 (C:\Users\free\Desktop\study\rust\hello_cargo) Finished dev [unoptimized + debuginfo] target(s) in 1.04s
---
에라이.. 역시 윈도우는 취미/개발용이 아니라 엔터테인먼트 용이었나!? (뜬금없이 분노중)
C:\Users\user\Desktop\study\rust>cargo new hello_cargo Created binary (application) `hello_cargo` package
C:\Users\user\Desktop\study\rust\hello_cargo> cd hello_cargo
C:\Users\user\Desktop\study\rust\hello_cargo>cargo build Compiling hello_cargo v0.1.0 (C:\Users\free\Desktop\study\rust\hello_cargo) error: linker `link.exe` not found | = note: program not found
note: the msvc targets depend on the msvc linker but `link.exe` was not found
note: please ensure that Visual Studio 2017 or later, or Build Tools for Visual Studio were installed with the Visual C++ option.
note: VS Code is a different product, and is not sufficient.
error: could not compile `hello_cargo` due to previous error
C:\Users\user\Desktop\study\rust>rustc main.rs error: linker `link.exe` not found | = note: program not found
note: the msvc targets depend on the msvc linker but `link.exe` was not found
note: please ensure that Visual Studio 2017 or later, or Build Tools for Visual Studio were installed with the Visual C++ option.
note: VS Code is a different product, and is not sufficient.
error: aborting due to previous error
먼가 열심히 object 파일은 생성하는데 linker가 없어서 실행파일을 만드는건 실패한 듯.
C:\Users\user\Desktop\study\rust>dir C 드라이브의 볼륨에는 이름이 없습니다. 볼륨 일련 번호: 38F7-6D98
C:\Users\user\Desktop\study\rust 디렉터리
2023-05-09 오후 01:18 <DIR> . 2023-05-09 오후 01:18 <DIR> .. 2023-05-09 오후 01:18 1,224 main.398lq81sg45tyvtc.rcgu.o 2023-05-09 오후 01:18 508 main.main.b8591b61-cgu.0.rcgu.o 2023-05-09 오후 01:18 1,870 main.main.b8591b61-cgu.1.rcgu.o 2023-05-09 오후 01:18 1,651 main.main.b8591b61-cgu.2.rcgu.o 2023-05-09 오후 01:18 802 main.main.b8591b61-cgu.3.rcgu.o 2023-05-09 오후 01:18 2,396 main.main.b8591b61-cgu.4.rcgu.o 2023-05-09 오후 01:18 1,708 main.main.b8591b61-cgu.5.rcgu.o 2023-05-09 오후 01:18 46 main.rs 8개 파일 10,205 바이트 2개 디렉터리 127,890,599,936 바이트 남음
+
msvc 설치하고 나서 rustc 해서 빌드하니 아래와 같이 익숙한(!) pdb와 exe가 나온다.
C:\Users\user\Desktop\study\rust>rustc main.rs
C:\Users\user\Desktop\study\rust>dir C 드라이브의 볼륨에는 이름이 없습니다. 볼륨 일련 번호: 38F7-6D98
C:\Users\user\Desktop\study\rust 디렉터리
2023-05-09 오후 11:37 <DIR> . 2023-05-09 오후 11:37 <DIR> .. 2023-05-09 오후 01:29 <DIR> hello_cargo 2023-05-09 오후 11:37 163,840 main.exe 2023-05-09 오후 11:37 1,355,776 main.pdb 2023-05-09 오후 01:18 46 main.rs 2023-05-09 오후 01:34 16,904,109 The Rust Programming Language.pdf 4개 파일 18,423,771 바이트 3개 디렉터리 121,282,232,320 바이트 남음
The HTML format is available online athttps://doc.rust-lang.org/stable/book/and offline with installations of Rust made withrustup; runrustup docs --bookto open.
Requirements Building the book requires mdBook, ideally the same version that rust-lang/rust uses in this file. To get it: $ cargo install mdbook --version <version_num>
To get started you may need to restart your current shell. This would reload its PATH environment variable to include Cargo's bin directory (%USERPROFILE%\.cargo\bin).