Skip to content

Running & Compiling Code

Compiling to a Standalone Executable

In addition to interpreting or running scripts in-place using AOC compilation, you can compile your CrossBasic script into a native, standalone application:

# Basic build
xcompile AppOutputName /path/to/script/script.xs

# On Windows, you can explicitly include the .exe extension:
xcompile AppOutputName.exe C:\path\to\script\script.xs
  • AppOutputName

  • On Windows, this produces AppOutputName.exe.

  • On Linux, an ELF binary named AppOutputName.
  • On macOS, a Mach-O binary named AppOutputName.

GUI vs. Console

By default, the compiled app is a console application. To build a GUI (windowed) app—suppressing the console window—add the -GUI flag:

# Console app (default)
xcompile MyConsoleApp /path/to/script/script.xs

# GUI app (no console window on Windows)
xcompile MyGuiApp /path/to/script/script.xs -GUI

Running Without Compile Step

You can also use JIT compilation to interpret scripts directly (slower startup - marginal by milliseconds):

crossbasic --s file.xs

Cross-Platform Binaries

  • On Windows, outputs .exe
  • On Linux/macOS, outputs ELF / Mach-O binaries

That completes the Getting Started section. Proceed to the Language Reference to dive deeper into syntax, data types, and control structures!