How-To Guide

July 4, 2026 · View on GitHub

This file is part of Areg SDK
Copyright (c) 2021-2026, Aregtech (Artak Avetyan)
Contact: info[at]areg.tech
Website: https://www.areg.tech

This guide answers common questions about building, configuring, and using Areg SDK.


Table of Contents


1. Preprocessor Defines

Areg SDK provides preprocessor defines that customize behavior during compilation. You can enable or disable features, configure behaviors, and tailor the SDK to your application's requirements.

For a complete list of defines and usage examples, see the Preprocessor Definitions Guide.

[ ↑ Back to top ↑ ]

2. Building the SDK

Requirements

  • C++ Standard: C++17 or later
  • Build Tools: CMake 3.20+ or Microsoft Visual Studio
  • Code Generator: Java 17+ (for generating service interface code)

Supported Platforms

PlatformCompilersArchitectures
LinuxGCC 9+, Clang 10+x86, x86_64, ARM32, ARM64
WindowsMSVC 2019+, MinGW, Clangx86, x86_64
macOSApple Clangx86_64, ARM64
WSLGCC, Clangx86, x86_64

Build Guides

[ ↑ Back to top ↑ ]

3. Creating or Integrating Projects

You can create a new project or integrate Areg SDK into an existing one.

Integration Options

MethodGuide
CMakeIntegrating with CMake
Visual StudioIntegrating with Visual Studio

Quick Start

Use the project setup tool to scaffold a new project:

# Linux/macOS
./tools/setup-project.sh

# Windows
tools\setup-project.bat

Working Example

See the Areg SDK Demo repository for a complete integrated project example.

[ ↑ Back to top ↑ ]

4. Using Logging

Projects built with Areg SDK can include or exclude logging at compile time. When logging is enabled, individual log scopes and scope groups can be activated or deactivated at runtime.

Logging Documentation

DocumentDescription
Logging ConfigurationConfigure log output, levels, and scopes
Developing with LoggingAdd logging to your application code
Log Observer ApplicationMonitor logs in real time
Log Collector ServiceAggregate logs from multiple processes

Quick Example

#include "areg/trace/GETrace.h"

DEF_TRACE_SCOPE(myapp_main);

int main()
{
    Application::setup();
    TRACE_SCOPE(myapp_main);
    TRACE_INFO("Application started");
    // ... application code ...
    return 0;
}
[ ↑ Back to top ↑ ]

5. Using the Multitarget Router

The Multitarget Router (mtrouter) enables inter-process communication (IPC) between Areg-based applications. It can run as a standalone console application or as an operating system service.

When You Need mtrouter

  • Applications with Public services that communicate across processes
  • Distributed systems with services on multiple devices
  • Any multiprocess scenario using Areg IPC

Configuration

All applications connecting to mtrouter need the areg.init configuration file to specify connection settings.

Documentation

See the Multitarget Router Guide for:

  • Configuration options
  • Running as a console application
  • Installing as a system service (Linux, macOS, Windows)
  • Network topology setup
[ ↑ Back to top ↑ ]