Set Up Your Environment
Vix.cpp keeps the C++ toolchain visible. The vix CLI gives the project a cleaner workflow, and SDK profiles provide the Vix development layer, but the code is still compiled by a real C++ compiler and built as a native executable or library.
Before writing your first Vix.cpp program, make sure your machine has the normal C++ development tools installed.
What you need
A working Vix.cpp environment needs:
- a C++20 compiler
- CMake
- Ninja
- Git
- curl or another download tool
- the system libraries required by the SDK profile you use
The base CLI install gives you the vix command. SDK profiles are installed separately through vix upgrade --sdk.
Check your Vix installation:
vix --versionList available SDK profiles:
vix upgrade --sdk listInspect the profile you want to use:
vix upgrade --sdk info webThe info command is the best place to start because it shows the modules, system dependencies, and notes for that profile.
Check your toolchain
Run:
c++ --version
cmake --version
ninja --version
git --version2
3
4
If one of these commands is missing, install the missing tool before continuing.
Vix.cpp does not replace the compiler, CMake, or Ninja. It uses the native toolchain underneath and gives the project a more consistent workflow around it.
Ubuntu or Debian
Install the common development tools:
sudo apt update
sudo apt install -y \
build-essential \
cmake \
ninja-build \
pkg-config \
ca-certificates \
git \
curl \
tar \
unzip \
zip2
3
4
5
6
7
8
9
10
11
12
For the common Vix SDK profiles, install the usual development libraries:
sudo apt install -y \
nlohmann-json3-dev \
libssl-dev \
zlib1g-dev \
libsqlite3-dev \
libbrotli-dev \
libspdlog-dev \
libfmt-dev2
3
4
5
6
7
8
For MySQL database workflows:
sudo apt install -y libmysqlcppconn-devFor game-oriented workflows with SDL/OpenGL:
sudo apt install -y \
libsdl2-dev \
libsdl2-image-dev \
libgl1-mesa-dev2
3
4
Before installing a profile, inspect it:
vix upgrade --sdk info webThen install the profile:
vix upgrade --sdk webArch Linux
Install the base development tools:
sudo pacman -S --needed \
base-devel \
cmake \
ninja \
pkgconf \
git \
curl \
tar \
unzip \
zip2
3
4
5
6
7
8
9
10
Install common development libraries:
sudo pacman -S --needed \
nlohmann-json \
openssl \
zlib \
sqlite \
brotli \
spdlog \
fmt2
3
4
5
6
7
8
For MySQL database workflows, install the MySQL Connector/C++ package available for your system.
The base Vix CLI should not require MySQL to start. MySQL is only needed when your project uses MySQL-related database features.
Inspect the profile before installing it:
vix upgrade --sdk info webThen install the profile:
vix upgrade --sdk webFedora
Install the base development tools:
sudo dnf install -y \
gcc \
gcc-c++ \
cmake \
ninja-build \
pkgconf-pkg-config \
git \
curl \
tar \
unzip \
zip2
3
4
5
6
7
8
9
10
11
Install common development libraries:
sudo dnf install -y \
openssl-devel \
zlib-devel \
sqlite-devel \
brotli-devel \
spdlog-devel \
fmt-devel \
nlohmann-json-devel2
3
4
5
6
7
8
Then inspect and install the SDK profile you need:
vix upgrade --sdk info web
vix upgrade --sdk web2
macOS
Install Xcode Command Line Tools:
xcode-select --installWith Homebrew, install the common tools:
brew install cmake ninja pkg-config git curlInstall common development libraries:
brew install openssl@3 sqlite brotli spdlog fmt nlohmann-jsonFor game-oriented workflows:
brew install sdl2 sdl2_imageThen inspect and install the SDK profile you need:
vix upgrade --sdk info web
vix upgrade --sdk web2
Windows
On Windows, install one C++ toolchain:
- Visual Studio with the Desktop development with C++ workload
- Visual Studio Build Tools with MSVC
- clang-cl with a compatible Windows build environment
Also install:
- CMake
- Ninja
- Git
- PowerShell
For additional native dependencies, use the package manager that fits your environment, such as vcpkg.
Install Vix.cpp from PowerShell:
irm https://vixcpp.com/install.ps1 | iexThen restart your terminal and check:
vix --versionInspect and install a SDK profile:
vix upgrade --sdk list
vix upgrade --sdk info web
vix upgrade --sdk web2
3
Install the SDK profile you need
Vix.cpp v2.7.0 uses SDK profiles so your machine does not need to install every optional development layer by default.
For web applications, APIs, middleware, WebSocket, validation, crypto, WebRPC, and requests:
vix upgrade --sdk webFor database, ORM, key-value storage, and cache workflows:
vix upgrade --sdk dataFor desktop shell workflows:
vix upgrade --sdk desktopFor peer-to-peer and local-first systems:
vix upgrade --sdk p2pFor game-oriented workflows:
vix upgrade --sdk gameFor local agent tooling:
vix upgrade --sdk agentFor full development and release validation machines:
vix upgrade --sdk allUse all only when the machine really needs the full SDK surface.
Inspect before installing
Before installing a SDK profile, inspect it:
vix upgrade --sdk info webThe output shows:
- the profile name
- the platform
- the modules included in the profile
- the system dependencies needed by the profile
- notes about the intended use
- the install command
This avoids guessing system packages manually.
Verify the environment
Check the Vix CLI:
vix --versionCheck your toolchain:
c++ --version
cmake --version
ninja --version2
3
Check Vix environment information:
vix infoRun the Vix doctor command:
vix doctorFor production-oriented checks, use the production doctor command when your project reaches that stage:
vix doctor productionVerify with a small C++ file
Create a temporary folder:
mkdir -p ~/tmp/vix-env-test
cd ~/tmp/vix-env-test2
Create main.cpp:
cat > main.cpp <<'CPP'
#include <vix.hpp>
int main()
{
vix::print("Hello from Vix.cpp");
return 0;
}
CPP2
3
4
5
6
7
8
9
Run it:
vix run main.cppExpected output:
Hello from Vix.cppIf this works, the CLI, SDK profile, compiler, and build workflow are ready for a basic Vix.cpp program.
Verify with a project
Create a project:
vix new api
cd api2
Build it:
vix buildRun it:
vix runStart development mode:
vix devThis confirms that your environment can create, build, run, and restart a Vix.cpp project through the normal workflow.
Common environment problems
vix: command not found
Your shell cannot find the Vix binary.
On Linux and macOS, add ~/.local/bin to your PATH.
Bash:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc2
Zsh:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc2
Then check again:
vix --versioncmake: command not found
Install CMake.
Ubuntu or Debian:
sudo apt install -y cmakeArch Linux:
sudo pacman -S --needed cmakemacOS:
brew install cmakeninja: command not found
Install Ninja.
Ubuntu or Debian:
sudo apt install -y ninja-buildArch Linux:
sudo pacman -S --needed ninjamacOS:
brew install ninja#include <vix.hpp> not found
The SDK profile needed by your project is not installed, or your project cannot find the SDK path.
Install the profile you need:
vix upgrade --sdk webThen try again:
vix run main.cppFor CMake projects, pass the SDK prefix manually if needed:
cmake -S . -B build -DCMAKE_PREFIX_PATH="$HOME/.local"
cmake --build build2
find_package(Vix CONFIG REQUIRED) fails
Install the SDK profile required by your project:
vix upgrade --sdk webThen configure with the local prefix:
cmake -S . -B build -DCMAKE_PREFIX_PATH="$HOME/.local"Build again:
cmake --build buildMissing OpenSSL, SQLite, Brotli, fmt, or spdlog
Install the system libraries required by the SDK profile.
Start by inspecting the profile:
vix upgrade --sdk info webThen install the listed packages for your operating system.
MySQL runtime error on older Vix releases
Older Vix.cpp releases could fail at startup on systems without the MySQL Connector/C++ runtime installed.
Upgrade the CLI:
vix upgradeThen check:
vix --versionIn Vix.cpp v2.7.0 and later, the base CLI should not require MySQL to start. MySQL dependencies belong to database/MySQL workflows and the SDK/profile layer.
Recommended local setup
For most developers starting with Vix.cpp on Linux, this is enough:
sudo apt update
sudo apt install -y \
build-essential \
cmake \
ninja-build \
pkg-config \
ca-certificates \
git \
curl \
tar \
unzip \
zip \
nlohmann-json3-dev \
libssl-dev \
zlib1g-dev \
libsqlite3-dev \
libbrotli-dev \
libspdlog-dev \
libfmt-dev2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Then:
curl -fsSL https://vixcpp.com/install.sh | bash
vix upgrade --sdk info web
vix upgrade --sdk web
vix --version
vix doctor2
3
4
5
What you should remember
Vix.cpp uses the native C++ toolchain underneath.
The CLI gives you the command workflow.
SDK profiles give your project the native development layer it needs.
Use this sequence when setting up a new machine:
vix --version
c++ --version
cmake --version
ninja --version
vix upgrade --sdk list
vix upgrade --sdk info web
vix upgrade --sdk web
vix doctor2
3
4
5
6
7
8
Next step
Now run your first C++ file with Vix.cpp.
Next: Run Your First C++ File
