Portál AbcLinuxu, 10. června 2025 10:27
hide@hide:~$ cd rust/ hide@hide:~/rust$ vim hello.rs hide@hide:~/rust$ rustc hello.rs hide@hide:~/rust$ ./hello Hello World! hide@hide:~/rust$ ldd hello linux-gate.so.1 (0xb76e6000) libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xb7692000) librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0xb7688000) libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb7668000) libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xb764a000) libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb7470000) /lib/ld-linux.so.2 (0xb76e8000) hide@hide:~/rust$ vim main.c hide@hide:~/rust$ gcc main.c -o main hide@hide:~/rust$ ldd main linux-gate.so.1 (0xb7788000) libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb7588000) /lib/ld-linux.so.2 (0xb778a000) hide@hide:~/rust$ cat hello.rs // This is a comment, and will be ignored by the compiler // You can test this code by clicking the "Run" button over there -> // or if prefer to use your keyboard, you can use the "Ctrl + Enter" shortcut // This code is editable, feel free to hack it! // You can always return to the original code by clicking the "Reset" button -> // This is the main function fn main() { // The statements here will be executed when the compiled binary is called // Print text to the console println!("Hello World!"); } hide@hide:~/rust$ cat main.c #include <stdio.h> int main(int argc, char **argv) { puts("Hello world!"); return 0; } hide@hide:~/rust$
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.