开发环境选在WSL2下的Ubuntu 20.04,这里首先用apt来安装xmake。

sudo add-apt-repository ppa:xmake-io/xmake
sudo apt update
sudo apt install
xmake --version

创建一个c++的工程

我们使用xmake create命令创建一个C++的控制台项目,其中-l表示语言,-P表示创建一个工程Project$ xmake create -l c++ -P hello

create hello ...
[+]: src/main.cpp
[+]: xmake.lua
[+]: .gitignore
create ok!

构建运行

xmake 

# or