I've got two Hello World programs, written in C++ and Rust:
main.cpp
#include <iostream>
using namespace std;
int main() {
cout << "Hello World!" << endl;
}
main.rs
fn main() {
println!("Hello World!");
}
I compiled both of them using these commands:
g++ main.cpp -o Test.bin
and
rustc main.rs -o Test-Rust.bin
Checking for the MIME-type of the C++ binary returned an executable, as I expected:
$ file --mime-type Test.bin
Test.bin: application/x-executable
But the Rust binary appears to be a shared library:
$ file --mime-type Test-Rust.bin
Test-Rust.bin: application/x-sharedlib
Why does the Rust compiler not output a plain application like g++
does?