Build & Run

Press F9 to compile, link, and run your application in a single step. HarbourBuilder orchestrates the entire build process automatically, from preprocessing your .prg files to launching the resulting executable.

One Key to Build

Press F9 and HarbourBuilder handles everything: Harbour compilation, C compiler invocation, linking, resource embedding, and launching your app. No makefiles, no command-line scripts, no manual steps.

The 7-Step Build Process

graph LR S1["1. Preprocess\n.prg files"] --> S2["2. Compile\nHarbour → .c"] S2 --> S3["3. Compile C\n.c → .o / .obj"] S3 --> S4["4. Link\n.o + libs → exe"] S4 --> S5["5. Embed\nresources"] S5 --> S6["6. Validate\ncheck errors"] S6 --> S7["7. Launch\nrun the app"] style S1 fill:#d2a8ff,stroke:#bc8cff,color:#0d1117 style S2 fill:#58a6ff,stroke:#388bfd,color:#0d1117 style S3 fill:#58a6ff,stroke:#388bfd,color:#0d1117 style S4 fill:#3fb950,stroke:#2ea043,color:#0d1117 style S5 fill:#f0883e,stroke:#db6d28,color:#0d1117 style S6 fill:#f0883e,stroke:#db6d28,color:#0d1117 style S7 fill:#3fb950,stroke:#2ea043,color:#0d1117

Step Details

StepToolInputOutputDescription
1. PreprocessHarbour.prg, .ch.ppoProcesses #include, #define, and xBase preprocessor directives.
2. CompileHarbour.ppo.cTranslates preprocessed Harbour source into C code.
3. Compile CC Compiler.c.o / .objInvokes MSVC, BCC, GCC, or Clang to produce object files.
4. LinkLinker.o / .obj.exeLinks object files with Harbour runtime libraries and system libs.
5. EmbedResource toolicons, images.exeEmbeds application resources (icons, images, forms) into the executable.
6. ValidateIDEbuild logreportChecks for compilation/linking errors and displays them in the Build Messages panel.
7. LaunchIDE.exerunning appLaunches the compiled application for testing.

Progress Dialog

During the build, a progress dialog shows real-time status of each step:

Error Dialog

If the build fails, an error dialog appears with:

Build Messages Panel

The Build Messages panel at the bottom of the IDE shows the output from every build:

ColumnDescription
TypeError (red), Warning (yellow), or Info (blue) icon.
FileSource file where the message originated.
LineLine number of the issue.
MessageCompiler or linker error description.
Clickable Errors

Double-click any error in the Build Messages panel to jump directly to that line in the source editor. The editor highlights the problematic line for quick identification.

Keyboard Shortcuts

ShortcutAction
F9Compile and run
Ctrl+F9Compile only (do not run)
Shift+F9Rebuild all (clean + full compile)
F5Start debugging (compile with debug flags)
Ctrl+Shift+BBuild current file only

Multi-Compiler Support

HarbourBuilder supports multiple C compilers for the linking step. Choose the one that best suits your platform and licensing:

CompilerPlatformsLicenseNotes
MSVC (Microsoft Visual C++)WindowsProprietary (free Build Tools available)Recommended for Windows. Best performance and compatibility.
BCC (Borland C++ Compiler)WindowsProprietary (free version available)Legacy support. Compatible with older Harbour builds.
GCCLinux, macOS (via Xcode)GPLDefault on Linux. Available on macOS via Homebrew or Xcode.
ClangmacOS, LinuxBSD-styleRecommended for macOS. Part of Xcode Command Line Tools.

Smart Rebuild

HarbourBuilder uses a dependency-tracking system to avoid unnecessary recompilation:

Smart vs. Full Rebuild

Press F9 for a smart build (only changed files). Press Shift+F9 for a full rebuild (clean everything and recompile all files). Use a full rebuild after changing compiler settings, adding library dependencies, or when incremental builds produce unexpected results.

Project Options

Configure your build settings via Project > Options:

CategoryOptions
CompilerHarbour flags: -n2, -w3, -gc, -gl, -gh, -b, and custom flags.
C CompilerSelect compiler (MSVC/BCC/GCC/Clang), include paths, defines, optimization level.
LinkerLibrary paths, additional libraries, subsystem (console/GUI), output file name.
ResourcesIcon file, manifest, embedded files, resource compiler flags.
OutputOutput directory, executable name, working directory, command-line arguments.
DebugEnable debug build (-gh -b), generate map file, symbol output.

Build Output Directory

By default, compiled output goes to the output/ folder within your project. You can customize this in Project Options:

FileDescription
myapp.exeThe compiled application (Windows) or binary (macOS/Linux).
myapp.hrbBytecode file (when compiled with -b flag for debugging).
myapp.mapLinker map file (if enabled in project options).
*.o / *.objIntermediate object files (retained for smart rebuild).
Release Builds

For distribution, do a clean rebuild (Shift+F9) without debug flags (-gh -b). This produces a smaller, faster executable with no debug symbols embedded.

On This Page

Getting Started Component Palette IDE Features Tutorials Reference Platforms The 7-Step Build Process Step Details Progress Dialog Error Dialog Build Messages Panel Keyboard Shortcuts Multi-Compiler Support Smart Rebuild Project Options Build Output Directory