Skip to content

Installation & Setup

🛠 Prerequisites

  • Supported OS

  • Windows 10+

  • macOS 10.14+
  • Linux (glibc ≥ 2.17)
  • C++ Toolchain (for building plugins & from-source)

  • Windows: MSVC 2019+ or MinGW-w64

  • macOS: Xcode command-line tools
  • Linux: g++ (GCC 8+)
  • Optional: SQLite3 development headers (for DB support)

⬇️ Download & Install (Binaries)

  1. Get the latest release from GitHub: https://github.com/simulanics/CrossBasic/releases
  2. Extract into your preferred folder:

# Linux/macOS
tar -xzf crossbasic-1.2.3-linux.tar.gz -C ~/crossbasic

# Windows (PowerShell)
Expand-Archive crossbasic-1.2.3-win.zip -DestinationPath C:\CrossBasic
3. Add to PATH (optional, for crossbasicc CLI):

# Linux/macOS
echo 'export PATH="$HOME/crossbasic/bin:$PATH"' >> ~/.bashrc

# Windows (PowerShell)
[Environment]::SetEnvironmentVariable(
  "Path", $Env:Path + ";C:\CrossBasic\bin", "User"
)

🚀 Build from Source

1. Clone Repository

git clone https://github.com/simulanics/CrossBasic
cd CrossBasic

2. Install Dependencies

On Windows, use the CrossBasicDevKit for all necessary libs. You’ll only need Git and Rust (if building Rust plugins).

3. Automated Build

Run the provided scripts:

# Linux/macOS
chmod +x build_crossbasic.sh build_plugins.sh
./build_crossbasic.sh
./build_plugins.sh

# Windows
build_crossbasic.bat
build_plugins.bat

4. Manual Build

Compile with optimizations:

g++ -std=c++17 -O3 -march=native -mtune=native -flto \
    -o crossbasic crossbasic.cpp -lffi

5. Run a Script

Create test.xs:

Function AddTwoNumbers(num1 As Integer, num2 As Integer) As Integer
  Return num1 + num2
End Function

Public Sub Main()
  Dim result As Integer = AddTwoNumbers(2, 3)
  Print Str(result)
End Sub

Main()

Compile & run:

./crossbasic --s test.xs

🔍 Debugging

Enable verbose trace with --d true:

./crossbasic --s test.xs --d true > debug.log

The detailed log covers lexing, parsing, compiling, VM execution, and plugin loading.


Happy coding with CrossBasic! 🚀