Free open-source modern C++20/23 framework to create console (CLI), forms (GUI like WinForms) and unit test (xUnit) applications and libraries on Windows, macOS, Linux, iOS, Android, FreeBSD, Haiku, and SerenityOS.
See the codeWrite Once, Run Everywhere!
xtd (pronounced "extend") is a modern C++20/23 framework to create console (CLI), forms (GUI) and unit test (xUnit) multiplatform applications and libraries.
xtd consists of several libraries.
The xtd.core library is modern C++20/23 libraries of classes, interfaces, and value types that provide access to system functionality. It is the foundation on which c++ applications, components, and controls are built.
The xtd.drawing library contains types that support basic GDI+ graphics functionality. Child namespaces support advanced two-dimensional and vector graphics functionality, advanced imaging functionality, and print-related and typographical services. A child namespace also contains types that extend design-time user-interface logic and drawing.
The xtd.forms library contains classes for creating Windows-based applications that take full advantage of the rich user interface features available in the Microsoft Windows, Apple macOS and linux-based operating system.
The xtd.tunit library is a unit-testing framework for modern C++20, inspired by Microsoft.VisualStudio.TestTools.Cpp.
This project is an open source project. The developers who participate do so on their own time. It is therefore difficult to set release dates.
But you can follow the evolution of the development. We keep the status up to date.
At each commit, a build and unit tests are performed for the following configurations
(*) xtd.core and xtd.tunit only.
As xtd is managed by a Kanban project, the number of open issues can be quite large. The table below gives a clearer view on the number of open bugs/questions and enhancements.
(**) There is only one enhancement for xtd 0.1.0, as project management was not yet available.
The classic first application 'Hello World'.
This example demonstrates how to display a simple message in the console using xtd.
#include <xtd/xtd>
class example {
public:
static auto main() {
console::background_color(console_color::blue);
console::foreground_color(console_color::white);
console::write_line("Hello, World!");
}
};
startup_(example::main);
or simply
#include <xtd/xtd>
auto main() -> int {
console::out << background_color(console_color::blue) << foreground_color(console_color::white) << "Hello, World!" << environment::new_line;
}
cmake_minimum_required(VERSION 3.20)
project(hello_world_console)
find_package(xtd REQUIRED)
add_sources(hello_world_console.cpp)
target_type(CONSOLE_APPLICATION)
Open "Command Prompt" or "Terminal". Navigate to the folder that contains the project and type the following:
xtdc run

This example asynchronously prints a greeting for each world in parallel, then waits for all greetings to be printed.
#include <xtd/xtd>
class program {
public:
static auto main() async_ {
auto worlds = {u8"World"_s, u8"Mundo"_s, u8"Monde"_s, u8"Mondo"_s, u8"モンド"_s, u8"世界"_s, u8"Welt"_s, u8"Мир"_s};
co_await parallel::for_each_async(worlds, [](auto world) async_ {
co_await task<>::delay(100_ms);
println("Hello, {}!", world);
});
}
};
startup_(program::main);
or simply
#include <xtd/xtd>
auto main_async() -> task<> {
auto worlds = {u8"World"_s, u8"Mundo"_s, u8"Monde"_s, u8"Mondo"_s, u8"モンド"_s, u8"世界"_s, u8"Welt"_s, u8"Мир"_s};
co_await parallel::for_each_async(worlds, [](auto world) -> task<> {
co_await task<>::delay(100_ms);
println("Hello, {}!", world);
});
}
auto main() -> int {
return startup::run(main_async);
}
cmake_minimum_required(VERSION 3.20)
project(hello_world_coroutine)
find_package(xtd REQUIRED)
add_sources(hello_world_coroutine.cpp)
target_type(CONSOLE_APPLICATION)
Open "Command Prompt" or "Terminal". Navigate to the folder that contains the project and type the following:
xtdc run
Hello, 世界!
Hello, Мир!
Hello, World!
Hello, Welt!
Hello, Mondo!
Hello, Monde!
Hello, モンド!
Hello, Mundo!
This example demonstrates how to create a simple graphical application using xtd forms.
#include <xtd/xtd>
class main_form : public form {
public:
static auto main() {
application::run(main_form {});
}
main_form() {
text("Hello world (message_box)");
button1.location({10, 10});
button1.parent(self_);
button1.text("&Click me");
button1.click += delegate_ {
message_box::show("Hello, World!");
};
}
private:
button button1;
};
startup_(main_form::main);
or simply
#include <xtd/xtd>
auto main() -> int {
auto main_form = form::create("Hello world (message_box)");
auto button1 = button::create(main_form, "&Click me", {10, 10});
button1.click += [] {message_box::show("Hello, World!");};
application::run(main_form);
}
cmake_minimum_required(VERSION 3.20)
project(hello_world_forms)
find_package(xtd REQUIRED)
add_sources(hello_world_forms.cpp)
target_type(GUI_APPLICATION)
Open "Command Prompt" or "Terminal". Navigate to the folder that contains the project and type the following:
xtdc run






This example demonstrates how to write and run unit tests using xtd.tunit.
#include <xtd/xtd>
namespace unit_tests {
class test_class_(hello_world_test) {
auto test_method_(create_string_from_literal) {
auto s = string {"Hello, World!"};
valid_that(s.length()).is().equal_to(13_z);
assert_that(s).is().equal_to("Hello, World!");
}
auto test_method_(create_string_from_chars) {
auto s = string {'H', 'e', 'l', 'l', 'o', ',', ' ', 'W', 'o', 'r', 'l', 'd', '!'};
valid_that(s.length()).is().equal_to(13_z);
assert_that(s).does().start_with("Hello,").and_().does().end_with(" World!");
}
static auto main() {
console_unit_test {}.run();
}
};
}
startup_(unit_tests::hello_world_test::main);
or without constraints
#include <xtd/xtd>
namespace unit_tests {
class test_class_(hello_world_test) {
auto test_method_(create_string_from_literal) {
auto s = string {"Hello, World!"};
valid::are_equal(13_z, s.length());
assert::are_equal("Hello, World!", s);
}
auto test_method_(create_string_from_chars) {
auto s = string {'H', 'e', 'l', 'l', 'o', ',', ' ', 'W', 'o', 'r', 'l', 'd', '!'};
valid::are_equal(13_z, s.length());
string_assert::starts_with("Hello,", s);
string_assert::does_end_with(" World!", s);
}
static auto main() {
console_unit_test {}.run();
}
};
}
startup_(unit_tests::hello_world_test::main);
cmake_minimum_required(VERSION 3.20)
project(hello_world_test)
find_package(xtd REQUIRED)
add_sources(hello_world_test.cpp)
target_type(TEST_APPLICATION)
Open "Command Prompt" or "Terminal". Navigate to the folder that contains the project and type the following:
xtdc run


xtdc-gui - Create a new project (on macOS)
The authors file lists contributors together with contact information. If you make a contribution, please add yourself to the list.
Your contributions are welcome.
Your feedback is important for the evolution of the project.
The following project aims to simplify and guide the way beginners make their first contribution. If you are looking to make your first contribution, check out the project below.
Now you are ready to make your first contribution to xtd.
© 2026 Gammasoft.
418 followers · starred Nov 2025
120 followers · starred Aug 2025
23 followers · starred Apr 2024
62 followers · starred Aug 2025
Free open-source modern C++20/23 framework to create console (CLI), forms (GUI like WinForms) and unit test (xUnit) applications and libraries on Windows, macOS, Linux, iOS, Android, FreeBSD, Haiku, and SerenityOS.
See the codeWrite Once, Run Everywhere!
xtd (pronounced "extend") is a modern C++20/23 framework to create console (CLI), forms (GUI) and unit test (xUnit) multiplatform applications and libraries.
xtd consists of several libraries.
The xtd.core library is modern C++20/23 libraries of classes, interfaces, and value types that provide access to system functionality. It is the foundation on which c++ applications, components, and controls are built.
The xtd.drawing library contains types that support basic GDI+ graphics functionality. Child namespaces support advanced two-dimensional and vector graphics functionality, advanced imaging functionality, and print-related and typographical services. A child namespace also contains types that extend design-time user-interface logic and drawing.
The xtd.forms library contains classes for creating Windows-based applications that take full advantage of the rich user interface features available in the Microsoft Windows, Apple macOS and linux-based operating system.
The xtd.tunit library is a unit-testing framework for modern C++20, inspired by Microsoft.VisualStudio.TestTools.Cpp.
This project is an open source project. The developers who participate do so on their own time. It is therefore difficult to set release dates.
But you can follow the evolution of the development. We keep the status up to date.
At each commit, a build and unit tests are performed for the following configurations
(*) xtd.core and xtd.tunit only.
As xtd is managed by a Kanban project, the number of open issues can be quite large. The table below gives a clearer view on the number of open bugs/questions and enhancements.
(**) There is only one enhancement for xtd 0.1.0, as project management was not yet available.
The classic first application 'Hello World'.
This example demonstrates how to display a simple message in the console using xtd.
#include <xtd/xtd>
class example {
public:
static auto main() {
console::background_color(console_color::blue);
console::foreground_color(console_color::white);
console::write_line("Hello, World!");
}
};
startup_(example::main);
or simply
#include <xtd/xtd>
auto main() -> int {
console::out << background_color(console_color::blue) << foreground_color(console_color::white) << "Hello, World!" << environment::new_line;
}
cmake_minimum_required(VERSION 3.20)
project(hello_world_console)
find_package(xtd REQUIRED)
add_sources(hello_world_console.cpp)
target_type(CONSOLE_APPLICATION)
Open "Command Prompt" or "Terminal". Navigate to the folder that contains the project and type the following:
xtdc run

This example asynchronously prints a greeting for each world in parallel, then waits for all greetings to be printed.
#include <xtd/xtd>
class program {
public:
static auto main() async_ {
auto worlds = {u8"World"_s, u8"Mundo"_s, u8"Monde"_s, u8"Mondo"_s, u8"モンド"_s, u8"世界"_s, u8"Welt"_s, u8"Мир"_s};
co_await parallel::for_each_async(worlds, [](auto world) async_ {
co_await task<>::delay(100_ms);
println("Hello, {}!", world);
});
}
};
startup_(program::main);
or simply
#include <xtd/xtd>
auto main_async() -> task<> {
auto worlds = {u8"World"_s, u8"Mundo"_s, u8"Monde"_s, u8"Mondo"_s, u8"モンド"_s, u8"世界"_s, u8"Welt"_s, u8"Мир"_s};
co_await parallel::for_each_async(worlds, [](auto world) -> task<> {
co_await task<>::delay(100_ms);
println("Hello, {}!", world);
});
}
auto main() -> int {
return startup::run(main_async);
}
cmake_minimum_required(VERSION 3.20)
project(hello_world_coroutine)
find_package(xtd REQUIRED)
add_sources(hello_world_coroutine.cpp)
target_type(CONSOLE_APPLICATION)
Open "Command Prompt" or "Terminal". Navigate to the folder that contains the project and type the following:
xtdc run
Hello, 世界!
Hello, Мир!
Hello, World!
Hello, Welt!
Hello, Mondo!
Hello, Monde!
Hello, モンド!
Hello, Mundo!
This example demonstrates how to create a simple graphical application using xtd forms.
#include <xtd/xtd>
class main_form : public form {
public:
static auto main() {
application::run(main_form {});
}
main_form() {
text("Hello world (message_box)");
button1.location({10, 10});
button1.parent(self_);
button1.text("&Click me");
button1.click += delegate_ {
message_box::show("Hello, World!");
};
}
private:
button button1;
};
startup_(main_form::main);
or simply
#include <xtd/xtd>
auto main() -> int {
auto main_form = form::create("Hello world (message_box)");
auto button1 = button::create(main_form, "&Click me", {10, 10});
button1.click += [] {message_box::show("Hello, World!");};
application::run(main_form);
}
cmake_minimum_required(VERSION 3.20)
project(hello_world_forms)
find_package(xtd REQUIRED)
add_sources(hello_world_forms.cpp)
target_type(GUI_APPLICATION)
Open "Command Prompt" or "Terminal". Navigate to the folder that contains the project and type the following:
xtdc run






This example demonstrates how to write and run unit tests using xtd.tunit.
#include <xtd/xtd>
namespace unit_tests {
class test_class_(hello_world_test) {
auto test_method_(create_string_from_literal) {
auto s = string {"Hello, World!"};
valid_that(s.length()).is().equal_to(13_z);
assert_that(s).is().equal_to("Hello, World!");
}
auto test_method_(create_string_from_chars) {
auto s = string {'H', 'e', 'l', 'l', 'o', ',', ' ', 'W', 'o', 'r', 'l', 'd', '!'};
valid_that(s.length()).is().equal_to(13_z);
assert_that(s).does().start_with("Hello,").and_().does().end_with(" World!");
}
static auto main() {
console_unit_test {}.run();
}
};
}
startup_(unit_tests::hello_world_test::main);
or without constraints
#include <xtd/xtd>
namespace unit_tests {
class test_class_(hello_world_test) {
auto test_method_(create_string_from_literal) {
auto s = string {"Hello, World!"};
valid::are_equal(13_z, s.length());
assert::are_equal("Hello, World!", s);
}
auto test_method_(create_string_from_chars) {
auto s = string {'H', 'e', 'l', 'l', 'o', ',', ' ', 'W', 'o', 'r', 'l', 'd', '!'};
valid::are_equal(13_z, s.length());
string_assert::starts_with("Hello,", s);
string_assert::does_end_with(" World!", s);
}
static auto main() {
console_unit_test {}.run();
}
};
}
startup_(unit_tests::hello_world_test::main);
cmake_minimum_required(VERSION 3.20)
project(hello_world_test)
find_package(xtd REQUIRED)
add_sources(hello_world_test.cpp)
target_type(TEST_APPLICATION)
Open "Command Prompt" or "Terminal". Navigate to the folder that contains the project and type the following:
xtdc run


xtdc-gui - Create a new project (on macOS)
The authors file lists contributors together with contact information. If you make a contribution, please add yourself to the list.
Your contributions are welcome.
Your feedback is important for the evolution of the project.
The following project aims to simplify and guide the way beginners make their first contribution. If you are looking to make your first contribution, check out the project below.
Now you are ready to make your first contribution to xtd.
© 2026 Gammasoft.
418 followers · starred Nov 2025
120 followers · starred Aug 2025
23 followers · starred Apr 2024
62 followers · starred Aug 2025