Mojo - first run
Ubuntu install
curl -ssL https://magic.modular.com/43a01b4c-d8e4-4b1d-a514-efa04460bf5c | bash
Initialize Project
magic init hello-world --format mojoproject
Go into new project and start mojo shell
cd hello-world && magic shell
Create your hello.mojo file
fn main():
print("Hello, world!")
Run the mojo file
mojo hello.mojo
Build an executable binary
mojo build hello.mojo
If getting the error: "mojo: error: unable to find suitable c++ compiler for linking"
add compilers to Ubuntu: sudo apt-get install build-essential
If getting error:
/usr/bin/ld: cannot find -lz: No such file or directory
/usr/bin/ld: cannot find -ltinfo: No such file or directory
collect2: error: ld returned 1 exit status
mojo: error: failed to link executable
sudo apt-get install zlib1g-dev libtinfo-dev
Run the binary
./hello
Run a different mojo app, like something you got from github...
magic run mojo hello_interop.mojo