所以就找到如何同時存在多個有 main 函式的檔案
e.g. 正常下用 cargo new 時檔案結構
$ cargo new mytest
$ cd mytest
$ tree .
mytest/
├── Cargo.toml
└── src
└── main.rs
測試這個 main 時只需要用 cargo run 執行即可
cargo 會去找 src/lib.rs 或 src/main.rs 當作程式進入點的檔案
$ cargo new mytest
$ cd mytest
$ tree .
mytest/
├── Cargo.toml
└── src
└── main.rs
該放起司的地方放起司,該放肉片的地方放肉片,再用左右大括號括起來,美味的 struct 完成了 (?
| Photo by Pablo Merchán Montes on Unsplash |
一片檸檬,一口茶,一個章節,一段時光
| Photo by Joanna Kosinska on Unsplash |
有一天,書與報紙只會剩下一個,我會希望的是我與報紙
因為我無法想像她一個人如何對抗孤獨
--- 呱吉
| Photo by Fabrizio Verrecchia on Unsplash |
捲走你以為放得下的思念,然後又被海浪給還了回來
| Photo by Spencer Watson on Unsplash |
我擁有你,你擁有我,最微妙的關係
| Photo by frank mckenna on Unsplash |
人生像充滿迴圈,每個迴圈又是不斷的選擇,一天,一年,一生
| Photo by Patrick McManaman on Unsplash |
植物是函式,蜜蜂是函式;接受別人的付出後再給予回饋
| Photo by Danilo Batista on Unsplash |
萬物形色多樣,卻又同由固定的基本元素構成,是型態構成型態?
| Photo by Jeremy Thomas on Unsplash |
相對於地上的我們,天上星星的存在是接近永恆不變的變與不變的道理....請參考前赤壁賦 (不要玩古文x
| Photo by John Fowler on Unsplash |
![]() |
| Photo by chuttersnap on Unsplash |
text_io = "0.1.6"
#[macro_use] extern crate text_io;
let s: String;
scan!("{}\n", s);
error: linking with `link.exe` failed: exit code: 1
|
= note: "link.exe" "/NOLOGO" "/NXCOMPAT" "/LIBPATH:C:\\Users\\user\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "hello.0.o" "/OUT:hello.exe" "/OPT:REF,NOICF" "/DEBUG" "/LIBPATH:C:\\Users\\user\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "C:\\Users\\user\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libstd-0a78323911070f99.rlib" "C:\\Users\\user\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librand-c279a51d66700350.rlib" "C:\\Users\\user\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcollections-d7bf31a4ca1ea637.rlib" "C:\\Users\\user\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libstd_unicode-d367c3ba0db49600.rlib" "C:\\Users\\user\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libpanic_unwind-2d4bf02140c11dcb.rlib" "C:\\Users\\user\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libunwind-add7a84d7e82d084.rlib" "C:\\Users\\user\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liblibc-84688accbc86d6b7.rlib" "C:\\Users\\user\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc-fe2e68b21f0bdd7a.rlib" "C:\\Users\\user\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc_system-7fc0381594c93f56.rlib" "C:\\Users\\user\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcore-ea9d77e7c23fe65c.rlib" "C:\\Users\\user\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcompiler_builtins-91b619d34dd1f5aa.rlib" "advapi32.lib" "ws2_32.lib" "userenv.lib" "shell32.lib" "msvcrt.lib"
= note: /usr/bin/link: 出現多餘的參數 ‘/LIBPATH:C:\\Users\\user\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib’
Try '/usr/bin/link --help' for more information.
error: aborting due to previous error